|
QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
|
Linear scale whose major tic labels come from a user supplied string list. More...
#include <qwt3d_scale.h>
Public Member Functions | |
| void | setLabels (const QVector< QString > &labels) |
| Sets the label list (indexed by major tic index) | |
| QVector< QString > | labels () const |
| Returns the label list. | |
Protected Member Functions | |
| QString | ticLabel (unsigned int idx) const override |
| Returns the custom label of the major tic at index idx. | |
| Qwt3DScale * | clone () const override |
| Returns a new heap based object utilized from Qwt3DClonePtr. | |
Protected Member Functions inherited from Qwt3DLinearScale | |
| Qwt3DLinearScale () | |
| Applies Qwt3DLinearAutoScaler::execute() for autoscaling. | |
| int | autoscale (double &a, double &b, double start, double stop, int ivals) override |
| Autoscales the axis. | |
| void | calculate () override |
| Creates the major and minor vector for the scale. | |
| void | copyLinearScaleState (const Qwt3DLinearScale &other) |
| Copies the linear autoscaler state from another Qwt3DLinearScale. | |
Protected Member Functions inherited from Qwt3DScale | |
| virtual void | setLimits (double start, double stop) |
| Sets start and stop value for the scale. | |
| virtual void | setMajors (int val) |
| Sets number of major intervals. | |
| virtual void | setMinors (int val) |
| Sets number of minor intervals per major interval. | |
| virtual void | setMajorLimits (double start, double stop) |
| Sets value of first and last major tic. | |
| int | majors () const |
| Returns major intervals. | |
| int | minors () const |
| Returns minor intervals. | |
| const std::vector< double > & | majorTicks () const |
| Returns const reference to major tic positions. | |
| const std::vector< double > & | minorTicks () const |
| Returns const reference to minor tic positions. | |
| void | copyFrom (const Qwt3DScale &other) |
| Copies Qwt3DScale base state from another Qwt3DScale. | |
Friends | |
| class | Qwt3DAxis |
| class | Qwt3DClonePtr< Qwt3DScale > |
Linear scale whose major tic labels come from a user supplied string list.
Qwt3DAxis::drawTicLabel() asks the scale for the label of every major tic via ticLabel(idx). With this scale the depth axis of a waterfall can read "t=-2.4s", "frame 17", ... instead of plain numbers.
Qwt3DAxis::setScale() hands the scale object to a Qwt3DClonePtr, whose assignment calls clone(). Any derived scale that does not override clone() is sliced to its base class right inside setScale(), and the custom ticLabel() silently stops working. Qwt3DTextScale overrides clone(), so it survives the clone; user-defined scale classes must do the same.
|
overrideprotectedvirtual |
Returns a new heap based object utilized from Qwt3DClonePtr.
Qwt3DAxis::setScale() stores the object in a Qwt3DClonePtr whose assignment calls clone(). A derived scale without a clone() override would be sliced to the base class right there, silently dropping the custom ticLabel(). This override copies the base state (copyFrom) plus the label list.
Reimplemented from Qwt3DLinearScale.
| QVector< QString > Qwt3DTextScale::labels | ( | ) | const |
Returns the label list.
| void Qwt3DTextScale::setLabels | ( | const QVector< QString > & | labels | ) |
Sets the label list (indexed by major tic index)
Sets the label list used for the major tics.
| labels | Labels indexed by major tic index |
Indices beyond the list size fall back to the numeric label.
|
overrideprotectedvirtual |
Returns the custom label of the major tic at index idx.
| idx | The current major tic index |
Falls back to Qwt3DLinearScale::ticLabel() (the plain tic value) when idx is out of range, so a short label list never produces empty axis annotations.
Reimplemented from Qwt3DScale.