An abstract base class for widgets having a scale. More...
#include <qwt_abstract_scale.h>
Classes | |
class | PrivateData |
Public Member Functions | |
double | invTransform (int) const |
bool | isInverted () const |
double | lowerBound () const |
double | maximum () const |
double | minimum () const |
QwtAbstractScale (QWidget *parent=NULL) | |
const QwtScaleDiv & | scaleDiv () const |
QwtScaleEngine * | scaleEngine () |
const QwtScaleEngine * | scaleEngine () const |
const QwtScaleMap & | scaleMap () const |
int | scaleMaxMajor () const |
int | scaleMaxMinor () const |
double | scaleStepSize () const |
void | setLowerBound (double value) |
void | setScale (const QwtInterval &) |
Specify a scale. More... | |
void | setScale (const QwtScaleDiv &) |
Specify a scale. More... | |
void | setScale (double lowerBound, double upperBound) |
Specify a scale. More... | |
void | setScaleEngine (QwtScaleEngine *) |
Set a scale engine. More... | |
void | setScaleMaxMajor (int ticks) |
Set the maximum number of major tick intervals. More... | |
void | setScaleMaxMinor (int ticks) |
Set the maximum number of minor tick intervals. More... | |
void | setScaleStepSize (double stepSize) |
Set the step size used for calculating a scale division. More... | |
void | setUpperBound (double value) |
int | transform (double) const |
double | upperBound () const |
virtual | ~QwtAbstractScale () |
Destructor. More... | |
Protected Member Functions | |
QwtAbstractScaleDraw * | abstractScaleDraw () |
const QwtAbstractScaleDraw * | abstractScaleDraw () const |
virtual void | changeEvent (QEvent *) QWT_OVERRIDE |
void | rescale (double lowerBound, double upperBound, double stepSize) |
virtual void | scaleChange () |
Notify changed scale. More... | |
void | setAbstractScaleDraw (QwtAbstractScaleDraw *) |
Set a scale draw. More... | |
void | updateScaleDraw () |
Properties | |
double | lowerBound |
int | scaleMaxMajor |
int | scaleMaxMinor |
double | scaleStepSize |
double | upperBound |
Private Attributes | |
PrivateData * | m_data |
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 ... ).
Definition at line 36 of file qwt_abstract_scale.h.
|
explicit |
Constructor
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 scaleMaxMajor to 3.
Definition at line 57 of file qwt_abstract_scale.cpp.
|
virtual |
Destructor.
Definition at line 65 of file qwt_abstract_scale.cpp.
|
protected |
|
protected |
Definition at line 293 of file qwt_abstract_scale.cpp.
|
protectedvirtual |
double QwtAbstractScale::invTransform | ( | int | value | ) | const |
Translate a widget coordinate into a scale value
value | Widget coordinate |
Definition at line 381 of file qwt_abstract_scale.cpp.
bool QwtAbstractScale::isInverted | ( | ) | const |
Definition at line 390 of file qwt_abstract_scale.cpp.
double QwtAbstractScale::lowerBound | ( | ) | const |
double QwtAbstractScale::maximum | ( | ) | const |
Definition at line 409 of file qwt_abstract_scale.cpp.
double QwtAbstractScale::minimum | ( | ) | const |
Definition at line 399 of file qwt_abstract_scale.cpp.
|
protected |
Recalculate the scale division and update the scale.
lowerBound | Lower limit of the scale interval |
upperBound | Upper limit of the scale interval |
stepSize | Major step size |
Definition at line 429 of file qwt_abstract_scale.cpp.
|
protectedvirtual |
Notify changed scale.
Reimplemented in QwtDial, QwtThermo, QwtAbstractSlider, and QwtSlider.
Definition at line 416 of file qwt_abstract_scale.cpp.
const QwtScaleDiv & QwtAbstractScale::scaleDiv | ( | ) | const |
The scale division might have been assigned explicitly or calculated implicitly by rescale().
Definition at line 349 of file qwt_abstract_scale.cpp.
QwtScaleEngine* QwtAbstractScale::scaleEngine | ( | ) |
QwtScaleEngine * QwtAbstractScale::scaleEngine | ( | ) | const |
const QwtScaleMap & QwtAbstractScale::scaleMap | ( | ) | const |
Definition at line 357 of file qwt_abstract_scale.cpp.
int QwtAbstractScale::scaleMaxMajor | ( | ) | const |
int QwtAbstractScale::scaleMaxMinor | ( | ) | const |
double QwtAbstractScale::scaleStepSize | ( | ) | const |
|
protected |
Set a scale draw.
scaleDraw has to be created with new and will be deleted in the destructor or the next call of setAbstractScaleDraw().
Definition at line 277 of file qwt_abstract_scale.cpp.
void QwtAbstractScale::setLowerBound | ( | double | value | ) |
Set the lower bound of the scale
value | Lower bound |
Definition at line 79 of file qwt_abstract_scale.cpp.
void QwtAbstractScale::setScale | ( | const QwtInterval & | interval | ) |
Specify a scale.
Define a scale by an interval
The ticks are calculated using scaleMaxMinor(), scaleMaxMajor() and scaleStepSize().
interval | Interval |
Definition at line 145 of file qwt_abstract_scale.cpp.
void QwtAbstractScale::setScale | ( | const QwtScaleDiv & | scaleDiv | ) |
Specify a scale.
scaleMaxMinor(), scaleMaxMajor() and scaleStepSize() and have no effect.
scaleDiv | Scale division |
Definition at line 158 of file qwt_abstract_scale.cpp.
void QwtAbstractScale::setScale | ( | double | lowerBound, |
double | upperBound | ||
) |
Specify a scale.
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 |
Definition at line 130 of file qwt_abstract_scale.cpp.
void QwtAbstractScale::setScaleEngine | ( | QwtScaleEngine * | scaleEngine | ) |
Set a scale engine.
The scale engine is responsible for calculating the scale division and provides a transformation between scale and widget coordinates.
scaleEngine has to be created with new and will be deleted in the destructor or the next call of setScaleEngine.
Definition at line 316 of file qwt_abstract_scale.cpp.
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. |
Definition at line 189 of file qwt_abstract_scale.cpp.
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. |
Definition at line 219 of file qwt_abstract_scale.cpp.
void QwtAbstractScale::setScaleStepSize | ( | double | stepSize | ) |
Set the step size used for calculating a scale division.
The step size is 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 |
Definition at line 251 of file qwt_abstract_scale.cpp.
void QwtAbstractScale::setUpperBound | ( | double | value | ) |
Set the upper bound of the scale
value | Upper bound |
Definition at line 102 of file qwt_abstract_scale.cpp.
int QwtAbstractScale::transform | ( | double | value | ) | const |
Translate a scale value into a widget coordinate
value | Scale value |
Definition at line 369 of file qwt_abstract_scale.cpp.
|
protected |
Recalculate ticks and scale boundaries.
Definition at line 466 of file qwt_abstract_scale.cpp.
double QwtAbstractScale::upperBound | ( | ) | const |
|
private |
Definition at line 102 of file qwt_abstract_scale.h.
|
readwrite |
Definition at line 40 of file qwt_abstract_scale.h.
|
readwrite |
Definition at line 43 of file qwt_abstract_scale.h.
|
readwrite |
Definition at line 44 of file qwt_abstract_scale.h.
|
readwrite |
Definition at line 46 of file qwt_abstract_scale.h.
|
readwrite |
Definition at line 41 of file qwt_abstract_scale.h.