Class QAccelPlot::TextTickLabelFormatter¶
ClassList > QAccelPlot > TextTickLabelFormatter
A tick label formatter that maps integer tick indices to a user-supplied list of strings. More...
#include <TextTickLabelFormatter.hpp>
Inherits the following classes: QAccelPlot::TickLabelFormatter
Inheritance diagram¶
flowchart TB
classQAccelPlot_1_1TextTickLabelFormatter["QAccelPlot::TextTickLabelFormatter"]
classQAccelPlot_1_1TickLabelFormatter["QAccelPlot::TickLabelFormatter"]
classQAccelPlot_1_1TickLabelFormatter --> classQAccelPlot_1_1TextTickLabelFormatter
click classQAccelPlot_1_1TickLabelFormatter "../classQAccelPlot_1_1TickLabelFormatter/" "Open QAccelPlot::TickLabelFormatter"
external_base_classQAccelPlot_1_1TickLabelFormatter_1["QObject"]
external_base_classQAccelPlot_1_1TickLabelFormatter_1 --> classQAccelPlot_1_1TickLabelFormatter
Public Properties¶
| Type | Name |
|---|---|
| property QStringList | labels The ordered list of label strings, indexed by the integer tick value. |
Public Properties inherited from QAccelPlot::TickLabelFormatter¶
See QAccelPlot::TickLabelFormatter
| Type | Name |
|---|---|
| property QML_ANONYMOUSQJSValue | tickLabel Optional JavaScript callback function(value, tickStep) that overridesdoFormat() . |
Public Signals¶
| Type | Name |
|---|---|
| signal void | labelsChanged Emitted when the labels property changes. |
Public Signals inherited from QAccelPlot::TickLabelFormatter¶
See QAccelPlot::TickLabelFormatter
| Type | Name |
|---|---|
| signal void | formatChanged Emitted whenever a property that affects formatted output changes. |
| signal void | tickLabelChanged Emitted when the tickLabel property changes. |
Public Functions¶
| Type | Name |
|---|---|
| TextTickLabelFormatter (QObject * parent=nullptr) Constructs a TextTickLabelFormatter with the given__parent . |
|
| QStringList | labels () const Returns the current label list. |
| virtual qreal | minimumTickStep () override const Returns 1 , so a zoomed linear axis keeps one tick per label instead of ticks between labels. |
| void | setLabels (const QStringList & labels) Sets the label list to labels . |
Public Functions inherited from QAccelPlot::TickLabelFormatter¶
See QAccelPlot::TickLabelFormatter
| Type | Name |
|---|---|
| TickLabelFormatter (QObject * parent=nullptr) Constructs an TickLabelFormatter with the given__parent . |
|
| QString | format (qreal value, qreal tickStep) const Returns the display string for value at the given__tickStep . |
| QString | formatLogTick (qreal value) const Returns the display string for a major tick at value on a logarithmic axis. |
| virtual qreal | minimumTickStep () const Returns the smallest major tick step a linear axis may use with this formatter. |
| void | setTickLabel (const QJSValue & tickLabel) Sets the JavaScript override callback to tickLabel . |
| QJSValue | tickLabel () const Returns the optional JavaScript override callback. |
Protected Functions¶
| Type | Name |
|---|---|
| virtual QString | doFormat (qreal value, qreal tickStep) override const Returns the label at the integer value , or an empty string if__value is not an integer or is out of range. |
Protected Functions inherited from QAccelPlot::TickLabelFormatter¶
See QAccelPlot::TickLabelFormatter
| Type | Name |
|---|---|
| virtual QString | doFormat (qreal value, qreal tickStep) const = 0 Subclass entry point — returns the formatted label for value . |
| virtual QString | doFormatLogTick (qreal value) const Subclass entry point for log-scale major ticks — returns the label for value . |
Detailed Description¶
A tick on an integer value is labeled with the string at that index in labels. Other values and indices outside the list range are rendered as empty strings. On a linear axis, minimumTickStep() keeps ticks on whole numbers when the axis is zoomed in.
See also: NumericTickLabelFormatter, TickLabelFormatter
Public Properties Documentation¶
property labels¶
The ordered list of label strings, indexed by the integer tick value.
Public Signals Documentation¶
signal labelsChanged¶
Emitted when the labels property changes.
Public Functions Documentation¶
function TextTickLabelFormatter¶
Constructs a TextTickLabelFormatter with the given__parent .
function labels¶
Returns the current label list.
function minimumTickStep¶
Returns 1 , so a zoomed linear axis keeps one tick per label instead of ticks between labels.
Implements QAccelPlot::TickLabelFormatter::minimumTickStep
function setLabels¶
Sets the label list to labels .
Protected Functions Documentation¶
function doFormat¶
Returns the label at the integer value , or an empty string if__value is not an integer or is out of range.
virtual QString QAccelPlot::TextTickLabelFormatter::doFormat (
qreal value,
qreal tickStep
) override const
Implements QAccelPlot::TickLabelFormatter::doFormat
The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/formatters/TextTickLabelFormatter.hpp