Class QAccelPlot::TickLabelFormatter¶
ClassList > QAccelPlot > TickLabelFormatter
Abstract base class for tick label formatters. More...
#include <TickLabelFormatter.hpp>
Inherits the following classes: QObject
Inherited by the following classes: QAccelPlot::DateTimeTickLabelFormatter, QAccelPlot::NumericTickLabelFormatter, QAccelPlot::TextTickLabelFormatter
Inheritance diagram¶
flowchart TB
classQAccelPlot_1_1TickLabelFormatter["QAccelPlot::TickLabelFormatter"]
external_base_classQAccelPlot_1_1TickLabelFormatter_1["QObject"]
external_base_classQAccelPlot_1_1TickLabelFormatter_1 --> classQAccelPlot_1_1TickLabelFormatter
classQAccelPlot_1_1DateTimeTickLabelFormatter["QAccelPlot::DateTimeTickLabelFormatter"]
classQAccelPlot_1_1TickLabelFormatter --> classQAccelPlot_1_1DateTimeTickLabelFormatter
click classQAccelPlot_1_1DateTimeTickLabelFormatter "../classQAccelPlot_1_1DateTimeTickLabelFormatter/" "Open QAccelPlot::DateTimeTickLabelFormatter"
classQAccelPlot_1_1NumericTickLabelFormatter["QAccelPlot::NumericTickLabelFormatter"]
classQAccelPlot_1_1TickLabelFormatter --> classQAccelPlot_1_1NumericTickLabelFormatter
click classQAccelPlot_1_1NumericTickLabelFormatter "../classQAccelPlot_1_1NumericTickLabelFormatter/" "Open QAccelPlot::NumericTickLabelFormatter"
classQAccelPlot_1_1TextTickLabelFormatter["QAccelPlot::TextTickLabelFormatter"]
classQAccelPlot_1_1TickLabelFormatter --> classQAccelPlot_1_1TextTickLabelFormatter
click classQAccelPlot_1_1TextTickLabelFormatter "../classQAccelPlot_1_1TextTickLabelFormatter/" "Open QAccelPlot::TextTickLabelFormatter"
Public Properties¶
| Type | Name |
|---|---|
| property QML_ANONYMOUSQJSValue | tickLabel Optional JavaScript callback function(value, tickStep) that overridesdoFormat() . |
Public Signals¶
| 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 |
|---|---|
| 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) 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¶
Subclasses implement doFormat() to produce a display string for each tick value. An optional tickLabel JavaScript callback can override the default formatting at the QML level.
See also: NumericTickLabelFormatter, DateTimeTickLabelFormatter, TextTickLabelFormatter
Public Properties Documentation¶
property tickLabel¶
Optional JavaScript callback function(value, tickStep) that overridesdoFormat() .
Public Signals Documentation¶
signal formatChanged¶
Emitted whenever a property that affects formatted output changes.
signal tickLabelChanged¶
Emitted when the tickLabel property changes.
Public Functions Documentation¶
function TickLabelFormatter¶
Constructs an TickLabelFormatter with the given__parent .
function format¶
Returns the display string for value at the given__tickStep .
Calls the tickLabel JS callback if set; otherwise delegates to doFormat().
function formatLogTick¶
Returns the display string for a major tick at value on a logarithmic axis.
Log-scale ticks have no single step, so the tickLabel JS callback receives value as its tickStep. Without a callback this delegates to doFormatLogTick().
function minimumTickStep¶
Returns the smallest major tick step a linear axis may use with this formatter.
The axis raises a smaller "nice" step to this value. The default is 0, no minimum. Called from the scene graph sync as well as the GUI thread, so overrides must not call into QML.
function setTickLabel¶
Sets the JavaScript override callback to tickLabel .
function tickLabel¶
Returns the optional JavaScript override callback.
Protected Functions Documentation¶
function doFormat¶
Subclass entry point — returns the formatted label for value .
function doFormatLogTick¶
Subclass entry point for log-scale major ticks — returns the label for value .
The default implementation returns doFormat(value, value), using the tick's own magnitude as a proxy for the precision it needs.
The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/formatters/TickLabelFormatter.hpp