An abstract base class for widgets having a scale.
More...
#include <qwt_abstract_scale.h>
|
|
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 ...).
◆ QwtAbstractScale()
| QwtAbstractScale::QwtAbstractScale |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
◆ abstractScaleDraw() [1/2]
Return the scale draw (non-const version) (English only)
Return the scale draw object (non-const)
- Returns
- Scale draw object
- See also
- setAbstractScaleDraw()
◆ abstractScaleDraw() [2/2]
Return the scale draw (const version) (English only)
Return the scale draw object (const)
- Returns
- Scale draw object
- See also
- setAbstractScaleDraw()
◆ changeEvent()
| void QwtAbstractScale::changeEvent |
( |
QEvent * |
event | ) |
|
|
overrideprotectedvirtual |
Handle change events (English only)
Handle change events.
- Parameters
-
Invalidates internal caches if necessary (e.g., on locale change).
Reimplemented in QwtDial, QwtKnob, QwtSlider, and QwtThermo.
◆ invTransform()
| double QwtAbstractScale::invTransform |
( |
int |
value | ) |
const |
Transform a widget coordinate to scale value.
- Parameters
-
- Returns
- Corresponding scale coordinate for value
- See also
- scaleMap(), transform()
◆ isInverted()
| bool QwtAbstractScale::isInverted |
( |
| ) |
const |
Check if scale is inverted.
- Returns
- True if scale is increasing in opposite direction to widget coordinates
◆ lowerBound()
| double QwtAbstractScale::lowerBound |
( |
| ) |
const |
◆ maximum()
| double QwtAbstractScale::maximum |
( |
| ) |
const |
Return the maximum boundary.
- Returns
- The boundary with the larger value
- See also
- minimum(), lowerBound(), upperBound()
◆ minimum()
| double QwtAbstractScale::minimum |
( |
| ) |
const |
Return the minimum boundary.
- Returns
- The boundary with the smaller value
- See also
- maximum(), lowerBound(), upperBound()
◆ rescale()
| void QwtAbstractScale::rescale |
( |
double |
lowerBound, |
|
|
double |
upperBound, |
|
|
double |
stepSize |
|
) |
| |
|
protected |
Recalculate scale and update scale draw (English only)
Recalculate scale division and update scale.
- Parameters
-
| lowerBound | Lower limit of the scale interval |
| upperBound | Upper limit of the scale interval |
| stepSize | Major step size |
- See also
- scaleChange()
◆ scaleChange()
| void QwtAbstractScale::scaleChange |
( |
| ) |
|
|
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.
Reimplemented in QwtAbstractSlider, QwtDial, QwtSlider, and QwtThermo.
◆ scaleDiv()
| const QwtScaleDiv & QwtAbstractScale::scaleDiv |
( |
| ) |
const |
Return the scale division.
- Returns
- Scale boundaries and positions of the ticks
The scale division might have been assigned explicitly or calculated implicitly by rescale().
◆ scaleEngine() [1/2]
Return the scale engine (non-const version)
- Returns
- Scale engine object
- See also
- setScaleEngine()
◆ scaleEngine() [2/2]
Return the scale engine (const version)
- Returns
- Scale engine object
- See also
- setScaleEngine()
◆ scaleMap()
| const QwtScaleMap & QwtAbstractScale::scaleMap |
( |
| ) |
const |
Return the scale map.
- Returns
- Map to translate between scale and widget coordinates
◆ scaleMaxMajor()
| int QwtAbstractScale::scaleMaxMajor |
( |
| ) |
const |
Return the maximum number of major tick intervals.
- Returns
- Maximal number of major tick intervals
- See also
- setScaleMaxMajor(), scaleMaxMinor()
◆ scaleMaxMinor()
| int QwtAbstractScale::scaleMaxMinor |
( |
| ) |
const |
Return the maximum number of minor tick intervals.
- Returns
- Maximal number of minor tick intervals
- See also
- setScaleMaxMinor(), scaleMaxMajor()
◆ scaleStepSize()
| double QwtAbstractScale::scaleStepSize |
( |
| ) |
const |
◆ setAbstractScaleDraw()
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().
- See also
- abstractScaleDraw()
◆ setLowerBound()
| void QwtAbstractScale::setLowerBound |
( |
double |
value | ) |
|
Set the lower bound of the scale.
- Parameters
-
- See also
- lowerBound(), setScale(), setUpperBound()
- Note
- For inverted scales, the lower bound is greater than the upper bound
◆ setScale() [1/3]
| 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().
- Parameters
-
◆ setScale() [2/3]
| void QwtAbstractScale::setScale |
( |
const QwtScaleDiv & |
scaleDiv | ) |
|
Specify a scale by scale division.
When using this method, scaleMaxMinor(), scaleMaxMajor() and scaleStepSize() have no effect.
- Parameters
-
| scaleDiv | Scale division object |
- See also
- setAutoScale()
◆ setScale() [3/3]
| 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().
- Parameters
-
| lowerBound | Lower limit of the scale interval |
| upperBound | Upper limit of the scale interval |
- Note
- For inverted scales, the lower bound is greater than the upper bound
◆ setScaleEngine()
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().
- Parameters
-
| scaleEngine | Scale engine object |
◆ setScaleMaxMajor()
| void QwtAbstractScale::setScaleMaxMajor |
( |
int |
ticks | ) |
|
◆ setScaleMaxMinor()
| void QwtAbstractScale::setScaleMaxMinor |
( |
int |
ticks | ) |
|
◆ setScaleStepSize()
| 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.
- Parameters
-
| stepSize | Hint for the step size of the scale |
- See also
- scaleStepSize(), QwtScaleEngine::divideScale()
- Note
- Position and distance between major ticks also depends on scaleMaxMajor()
◆ setUpperBound()
| void QwtAbstractScale::setUpperBound |
( |
double |
value | ) |
|
Set the upper bound of the scale.
- Parameters
-
- See also
- upperBound(), setScale(), setLowerBound()
- Note
- For inverted scales, the lower bound is greater than the upper bound
◆ transform()
| int QwtAbstractScale::transform |
( |
double |
value | ) |
const |
Transform a scale value to widget coordinates.
- Parameters
-
- Returns
- Corresponding widget coordinate for value
- See also
- scaleMap(), invTransform()
◆ updateScaleDraw()
| void QwtAbstractScale::updateScaleDraw |
( |
| ) |
|
|
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.
◆ upperBound()
| double QwtAbstractScale::upperBound |
( |
| ) |
const |
The documentation for this class was generated from the following files:
- /home/runner/work/QWT/QWT/src/plot/qwt_abstract_scale.h
- /home/runner/work/QWT/QWT/src/plot/qwt_abstract_scale.cpp