|
QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
|
An abstract base class for widgets having a scale 更多...
#include <qwt_abstract_scale.h>
类 | |
| class | PrivateData |
Public 成员函数 | |
| QwtAbstractScale (QWidget *parent=nullptr) | |
| Constructor for QwtAbstractScale | |
| void | setScale (double lowerBound, double upperBound) |
| Specify a scale by interval bounds | |
| void | setScale (const QwtInterval &) |
| Specify a scale by interval | |
| void | setScale (const QwtScaleDiv &) |
| Specify a scale by scale division | |
| const QwtScaleDiv & | scaleDiv () const |
| Return the scale division | |
| void | setLowerBound (double value) |
| Set the lower bound of the scale | |
| double | lowerBound () const |
| Return the lower bound of the scale | |
| void | setUpperBound (double value) |
| Set the upper bound of the scale | |
| double | upperBound () const |
| Return the upper bound of the scale | |
| void | setScaleStepSize (double stepSize) |
| Set the step size used for calculating scale division | |
| double | scaleStepSize () const |
| Return the step size hint | |
| void | setScaleMaxMajor (int ticks) |
| Set the maximum number of major tick intervals | |
| int | scaleMaxMinor () const |
| Return the maximum number of minor tick intervals | |
| void | setScaleMaxMinor (int ticks) |
| Set the maximum number of minor tick intervals | |
| int | scaleMaxMajor () const |
| Return the maximum number of major tick intervals | |
| void | setScaleEngine (QwtScaleEngine *) |
| Set the scale engine | |
| const QwtScaleEngine * | scaleEngine () const |
| Return the scale engine (const version) | |
| QwtScaleEngine * | scaleEngine () |
| Return the scale engine (non-const version) | |
| int | transform (double) const |
| Transform a scale value to widget coordinates | |
| double | invTransform (int) const |
| Transform a widget coordinate to scale value | |
| bool | isInverted () const |
| Check if scale is inverted | |
| double | minimum () const |
| Return the minimum boundary | |
| double | maximum () const |
| Return the maximum boundary | |
| const QwtScaleMap & | scaleMap () const |
| Return the scale map | |
Protected 成员函数 | |
| virtual void | changeEvent (QEvent *) override |
| Handle change events (English only) | |
| void | rescale (double lowerBound, double upperBound, double stepSize) |
| Recalculate scale and update scale draw (English only) | |
| void | setAbstractScaleDraw (QwtAbstractScaleDraw *) |
| Set the scale draw object (English only) | |
| const QwtAbstractScaleDraw * | abstractScaleDraw () const |
| Return the scale draw (const version) (English only) | |
| QwtAbstractScaleDraw * | abstractScaleDraw () |
| Return the scale draw (non-const version) (English only) | |
| void | updateScaleDraw () |
| Update the scale draw (English only) | |
| virtual void | scaleChange () |
| Notify about scale changes (English only) | |
属性 | |
| double | lowerBound |
| double | upperBound |
| int | scaleMaxMajor |
| int | scaleMaxMinor |
| double | scaleStepSize |
An abstract base class for widgets having a scale
The scale of an QwtAbstractScale is determined by a QwtScaleDiv definition that contains the boundaries and the ticks of the scale. The scale is painted using a QwtScaleDraw object. The scale division might be assigned explicitly - but usually it is calculated from the boundaries using a QwtScaleEngine. The scale engine also decides the type of transformation of the scale (linear, logarithmic ...).
|
explicit |
Constructor for QwtAbstractScale
| parent | Parent widget |
Creates a default QwtScaleDraw and a QwtLinearScaleEngine. The initial scale boundaries are set to [ 0.0, 100.0 ] The scaleStepSize() is initialized to 0.0, scaleMaxMajor() to 5 and scaleMaxMinor to 3.
Destructor for QwtAbstractScale
|
protected |
Return the scale draw (non-const version) (English only)
Return the scale draw object (non-const)
|
protected |
Return the scale draw (const version) (English only)
Return the scale draw object (const)
|
overrideprotectedvirtual |
| double QwtAbstractScale::invTransform | ( | int | value | ) | const |
Transform a widget coordinate to scale value
| value | Widget coordinate |
| bool QwtAbstractScale::isInverted | ( | ) | const |
Check if scale is inverted
| double QwtAbstractScale::lowerBound | ( | ) | const |
| double QwtAbstractScale::maximum | ( | ) | const |
Return the maximum boundary
| double QwtAbstractScale::minimum | ( | ) | const |
Return the minimum boundary
|
protected |
Recalculate scale and update scale draw (English only)
Recalculate scale division and update scale
| lowerBound | Lower limit of the scale interval |
| upperBound | Upper limit of the scale interval |
| stepSize | Major step size |
|
protectedvirtual |
Notify about scale changes (English only)
Notify about scale changes
This virtual function is called when the scale changes. Override this function in derived classes to handle scale changes.
被 QwtAbstractSlider, QwtDial, QwtSlider , 以及 QwtThermo 重载.
| const QwtScaleDiv & QwtAbstractScale::scaleDiv | ( | ) | const |
Return the scale division
The scale division might have been assigned explicitly or calculated implicitly by rescale().
| QwtScaleEngine * QwtAbstractScale::scaleEngine | ( | ) |
| const QwtScaleEngine * QwtAbstractScale::scaleEngine | ( | ) | const |
| const QwtScaleMap & QwtAbstractScale::scaleMap | ( | ) | const |
Return the scale map
| int QwtAbstractScale::scaleMaxMajor | ( | ) | const |
Return the maximum number of major tick intervals
| int QwtAbstractScale::scaleMaxMinor | ( | ) | const |
Return the maximum number of minor tick intervals
| double QwtAbstractScale::scaleStepSize | ( | ) | const |
Return the step size hint
|
protected |
Set the scale draw object (English only)
Set the scale draw object
scaleDraw must be created with new and will be deleted in the destructor or the next call of setAbstractScaleDraw().
| void QwtAbstractScale::setLowerBound | ( | double | value | ) |
Set the lower bound of the scale
| value | Lower bound value |
| void QwtAbstractScale::setScale | ( | const QwtInterval & | interval | ) |
Specify a scale by interval
Define a scale by an interval. The ticks are calculated using scaleMaxMinor(), scaleMaxMajor() and scaleStepSize().
| interval | Interval object |
| void QwtAbstractScale::setScale | ( | const QwtScaleDiv & | scaleDiv | ) |
Specify a scale by scale division
When using this method, scaleMaxMinor(), scaleMaxMajor() and scaleStepSize() have no effect.
| scaleDiv | Scale division object |
| void QwtAbstractScale::setScale | ( | double | lowerBound, |
| double | upperBound | ||
| ) |
Specify a scale by interval bounds
Define a scale by an interval. The ticks are calculated using scaleMaxMinor(), scaleMaxMajor() and scaleStepSize().
| lowerBound | Lower limit of the scale interval |
| upperBound | Upper limit of the scale interval |
| void QwtAbstractScale::setScaleEngine | ( | QwtScaleEngine * | scaleEngine | ) |
Set the scale engine
The scale engine is responsible for calculating the scale division and provides a transformation between scale and widget coordinates. scaleEngine must be created with new and will be deleted in the destructor or the next call of setScaleEngine().
| scaleEngine | Scale engine object |
| void QwtAbstractScale::setScaleMaxMajor | ( | int | ticks | ) |
Set the maximum number of major tick intervals
The scale's major ticks are calculated automatically such that the number of major intervals does not exceed ticks. The default value is 5.
| ticks | Maximal number of major ticks |
| void QwtAbstractScale::setScaleMaxMinor | ( | int | ticks | ) |
Set the maximum number of minor tick intervals
The scale's minor ticks are calculated automatically such that the number of minor intervals does not exceed ticks. The default value is 3.
| ticks | Maximal number of minor ticks |
| void QwtAbstractScale::setScaleStepSize | ( | double | stepSize | ) |
Set the step size used for calculating scale division
The step size is a hint for calculating the intervals for the major ticks of the scale. A value of 0.0 is interpreted as no hint.
| stepSize | Hint for the step size of the scale |
| void QwtAbstractScale::setUpperBound | ( | double | value | ) |
Set the upper bound of the scale
| value | Upper bound value |
| int QwtAbstractScale::transform | ( | double | value | ) | const |
Transform a scale value to widget coordinates
| value | Scale value |
|
protected |
Update the scale draw (English only)
Recalculate ticks and scale boundaries
Updates the scale draw by recalculating ticks and boundaries based on the current scale division.
| double QwtAbstractScale::upperBound | ( | ) | const |