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. Overrides gradient 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 . Pass nullptr 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.
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 .
property gradient¶
A Qt Gradient (or compatible) object supplying the color stops.
property valueMax¶
Data-space value that maps to gradient position 1.0. Only used when valueMaxSource is Fixed.
property valueMaxSource¶
How the gradient normalization maximum is determined; see GradientValueSource .
property valueMin¶
Data-space value that maps to gradient position 0.0. Only used when valueMinSource is Fixed.
property valueMinSource¶
How the gradient normalization minimum is determined; see GradientValueSource .
Public Signals Documentation¶
signal colormapChanged¶
Emitted when the colormap property changes.
signal directionChanged¶
Emitted when the direction property changes.
signal gradientChanged¶
Emitted when the gradient property changes.
signal valueMaxChanged¶
Emitted when the valueMax property changes.
signal valueMaxSourceChanged¶
Emitted when the valueMaxSource property changes.
signal valueMinChanged¶
Emitted when the valueMin property changes.
signal valueMinSourceChanged¶
Emitted when the valueMinSource property changes.
Public Functions Documentation¶
function GradientStroke¶
Constructs a GradientStroke with the given__parent .
function colormap¶
Returns the colormap supplying color stops, or nullptr whengradient supplies them.
function direction¶
Returns the gradient direction.
function gradient¶
Returns the Qt Gradient object supplying color stops.
function payload¶
Returns a snapshot of all stroke parameters, updated on the GUI thread when the effect changes.
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.
Implements QAccelPlot::LineCurveEffect::refresh
function setColormap¶
Sets the colormap to colormap . Passnullptr to take the stops fromgradient .
function setDirection¶
Sets the gradient direction to direction .
function setGradient¶
Sets the Qt Gradient object to gradient .
function setValueMax¶
Sets the maximum data value for gradient normalization to value .
function setValueMaxSource¶
Sets the gradient normalization maximum source to source .
function setValueMin¶
Sets the minimum data value for gradient normalization to value .
function setValueMinSource¶
Sets the gradient normalization minimum source to source .
function valueMax¶
Returns the maximum data value for gradient normalization.
function valueMaxSource¶
Returns how the gradient normalization maximum is determined.
function valueMin¶
Returns the minimum data value for gradient normalization.
function valueMinSource¶
Returns how the gradient normalization minimum is determined.
The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/effects/GradientStroke.hpp