Skip to content

Class QAccelPlot::GradientStroke

ClassList > QAccelPlot > GradientStroke

A LineCurve effect that replaces the solid line color with a color gradient.More...

  • #include <GradientStroke.hpp>

Inherits the following classes: QAccelPlot::LineCurveEffect

Inheritance diagram

flowchart TB
  classQAccelPlot_1_1GradientStroke["QAccelPlot::GradientStroke"]

  classQAccelPlot_1_1LineCurveEffect["QAccelPlot::LineCurveEffect"]
  classQAccelPlot_1_1LineCurveEffect --> classQAccelPlot_1_1GradientStroke
  click classQAccelPlot_1_1LineCurveEffect "../classQAccelPlot_1_1LineCurveEffect/" "Open QAccelPlot::LineCurveEffect"

  external_base_classQAccelPlot_1_1LineCurveEffect_1["QObject"]
  external_base_classQAccelPlot_1_1LineCurveEffect_1 --> classQAccelPlot_1_1LineCurveEffect

Public Properties

Type Name
property Colormap * colormap
Colormap supplying the color stops. Overridesgradient when set.
property Qt::Orientation direction
Axis along which the gradient color varies:Qt.Horizontal for X values,Qt.Vertical for Y values. Default:Qt.Horizontal .
property QObject * gradient
A Qt Gradient (or compatible) object supplying the color stops.
property qreal valueMax
Data-space value that maps to gradient position 1.0. Only used when valueMaxSource is Fixed.
property GradientValueSource valueMaxSource
How the gradient normalization maximum is determined; see GradientValueSource .
property qreal valueMin
Data-space value that maps to gradient position 0.0. Only used when valueMinSource is Fixed.
property GradientValueSource valueMinSource
How the gradient normalization minimum is determined; see GradientValueSource .

Public Properties inherited from QAccelPlot::LineCurveEffect

See QAccelPlot::LineCurveEffect

Type Name
property QML_ANONYMOUSbool enabled
Whether this effect is active. Disabled effects are ignored during rendering.

Public Signals

Type Name
signal void colormapChanged
Emitted when the colormap property changes.
signal void directionChanged
Emitted when the direction property changes.
signal void gradientChanged
Emitted when the gradient property changes.
signal void valueMaxChanged
Emitted when the valueMax property changes.
signal void valueMaxSourceChanged
Emitted when the valueMaxSource property changes.
signal void valueMinChanged
Emitted when the valueMin property changes.
signal void valueMinSourceChanged
Emitted when the valueMinSource property changes.

Public Signals inherited from QAccelPlot::LineCurveEffect

See QAccelPlot::LineCurveEffect

Type Name
signal void effectChanged
Emitted when any effect property changes, requesting a curve redraw.
signal void enabledChanged
Emitted when the enabled property changes.

Public Functions

Type Name
GradientStroke (QObject * parent=nullptr)
Constructs a GradientStroke with the given__parent .
Colormap * colormap () const
Returns the colormap supplying color stops, or nullptr whengradient supplies them.
Qt::Orientation direction () const
Returns the gradient direction.
QObject * gradient () const
Returns the Qt Gradient object supplying color stops.
const GradientColorPayload & payload () const
Returns a snapshot of all stroke parameters, updated on the GUI thread when the effect changes.
virtual void refresh () override
Re-reads the gradient stops, which can change without a notification, and emitseffectChanged() if they differ from the snapshot.
void setColormap (Colormap * colormap)
Sets the colormap to colormap . Passnullptr to take the stops fromgradient .
void setDirection (Qt::Orientation direction)
Sets the gradient direction to direction .
void setGradient (QObject * gradient)
Sets the Qt Gradient object to gradient .
void setValueMax (qreal value)
Sets the maximum data value for gradient normalization to value .
void setValueMaxSource (GradientValueSource source)
Sets the gradient normalization maximum source to source .
void setValueMin (qreal value)
Sets the minimum data value for gradient normalization to value .
void setValueMinSource (GradientValueSource source)
Sets the gradient normalization minimum source to source .
qreal valueMax () const
Returns the maximum data value for gradient normalization.
GradientValueSource valueMaxSource () const
Returns how the gradient normalization maximum is determined.
qreal valueMin () const
Returns the minimum data value for gradient normalization.
GradientValueSource valueMinSource () const
Returns how the gradient normalization minimum is determined.

Public Functions inherited from QAccelPlot::LineCurveEffect

See QAccelPlot::LineCurveEffect

Type Name
LineCurveEffect (QObject * parent=nullptr)
Constructs an LineCurveEffect with the given__parent .
bool enabled () const
Returns true if the effect is active.
virtual void refresh ()
Re-reads inputs that can change without a notification and emits effectChanged() if they did.
void setEnabled (bool enabled)
Sets the effect's enabled state to enabled .

Detailed Description

Attach to LineCurve::effects to color the line with a gradient. The color stops come from colormap when set, otherwise from a Qt Gradient assigned to gradient. The gradient can run horizontally (along X data values) or vertically (along Y data values).

See also: GradientFill, Colormap, LineCurveEffect, LineCurve

Public Properties Documentation

property colormap

Colormap supplying the color stops. Overridesgradient when set.

Colormap* QAccelPlot::GradientStroke::colormap;

Only the ramp is used. Colormap::min, Colormap::max, and Colormap::logScale are ignored; valueMin and valueMax place the ramp instead.


property direction

Axis along which the gradient color varies:Qt.Horizontal for X values,Qt.Vertical for Y values. Default:Qt.Horizontal .

Qt::Orientation QAccelPlot::GradientStroke::direction;


property gradient

A Qt Gradient (or compatible) object supplying the color stops.

QObject* QAccelPlot::GradientStroke::gradient;


property valueMax

Data-space value that maps to gradient position 1.0. Only used when valueMaxSource is Fixed.

qreal QAccelPlot::GradientStroke::valueMax;


property valueMaxSource

How the gradient normalization maximum is determined; see GradientValueSource .

GradientValueSource QAccelPlot::GradientStroke::valueMaxSource;


property valueMin

Data-space value that maps to gradient position 0.0. Only used when valueMinSource is Fixed.

qreal QAccelPlot::GradientStroke::valueMin;


property valueMinSource

How the gradient normalization minimum is determined; see GradientValueSource .

GradientValueSource QAccelPlot::GradientStroke::valueMinSource;


Public Signals Documentation

signal colormapChanged

Emitted when the colormap property changes.

void QAccelPlot::GradientStroke::colormapChanged;


signal directionChanged

Emitted when the direction property changes.

void QAccelPlot::GradientStroke::directionChanged;


signal gradientChanged

Emitted when the gradient property changes.

void QAccelPlot::GradientStroke::gradientChanged;


signal valueMaxChanged

Emitted when the valueMax property changes.

void QAccelPlot::GradientStroke::valueMaxChanged;


signal valueMaxSourceChanged

Emitted when the valueMaxSource property changes.

void QAccelPlot::GradientStroke::valueMaxSourceChanged;


signal valueMinChanged

Emitted when the valueMin property changes.

void QAccelPlot::GradientStroke::valueMinChanged;


signal valueMinSourceChanged

Emitted when the valueMinSource property changes.

void QAccelPlot::GradientStroke::valueMinSourceChanged;


Public Functions Documentation

function GradientStroke

Constructs a GradientStroke with the given__parent .

explicit QAccelPlot::GradientStroke::GradientStroke (
    QObject * parent=nullptr
) 


function colormap

Returns the colormap supplying color stops, or nullptr whengradient supplies them.

Colormap * QAccelPlot::GradientStroke::colormap () const


function direction

Returns the gradient direction.

Qt::Orientation QAccelPlot::GradientStroke::direction () const


function gradient

Returns the Qt Gradient object supplying color stops.

QObject * QAccelPlot::GradientStroke::gradient () const


function payload

Returns a snapshot of all stroke parameters, updated on the GUI thread when the effect changes.

const GradientColorPayload & QAccelPlot::GradientStroke::payload () const

Does not read the QML gradient, so updatePaintNode() can call it on the render thread.


function refresh

Re-reads the gradient stops, which can change without a notification, and emitseffectChanged() if they differ from the snapshot.

virtual void QAccelPlot::GradientStroke::refresh () override

Implements QAccelPlot::LineCurveEffect::refresh


function setColormap

Sets the colormap to colormap . Passnullptr to take the stops fromgradient .

void QAccelPlot::GradientStroke::setColormap (
    Colormap * colormap
) 


function setDirection

Sets the gradient direction to direction .

void QAccelPlot::GradientStroke::setDirection (
    Qt::Orientation direction
) 


function setGradient

Sets the Qt Gradient object to gradient .

void QAccelPlot::GradientStroke::setGradient (
    QObject * gradient
) 


function setValueMax

Sets the maximum data value for gradient normalization to value .

void QAccelPlot::GradientStroke::setValueMax (
    qreal value
) 


function setValueMaxSource

Sets the gradient normalization maximum source to source .

void QAccelPlot::GradientStroke::setValueMaxSource (
    GradientValueSource source
) 


function setValueMin

Sets the minimum data value for gradient normalization to value .

void QAccelPlot::GradientStroke::setValueMin (
    qreal value
) 


function setValueMinSource

Sets the gradient normalization minimum source to source .

void QAccelPlot::GradientStroke::setValueMinSource (
    GradientValueSource source
) 


function valueMax

Returns the maximum data value for gradient normalization.

qreal QAccelPlot::GradientStroke::valueMax () const


function valueMaxSource

Returns how the gradient normalization maximum is determined.

GradientValueSource QAccelPlot::GradientStroke::valueMaxSource () const


function valueMin

Returns the minimum data value for gradient normalization.

qreal QAccelPlot::GradientStroke::valueMin () const


function valueMinSource

Returns how the gradient normalization minimum is determined.

GradientValueSource QAccelPlot::GradientStroke::valueMinSource () const



The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/effects/GradientStroke.hpp