#include <qwt_scldraw.h>
Inheritance diagram for QwtScaleDraw::
Public Types | |
enum | Orientation { Bottom, Top, Left, Right, Round } |
Public Methods | |
QwtScaleDraw () | |
virtual | ~QwtScaleDraw () |
void | setScale (const QwtScaleDiv &s) |
void | setScale (double vmin, double vmax, int maxMajIntv, int maxMinIntv, double step=0.0, int logarithmic=0) |
void | setGeometry (int xorigin, int yorigin, int length, Orientation o) |
int | x () const |
int | y () const |
int | length () const |
Orientation | orientation () const |
void | setAngleRange (double angle1, double angle2) |
void | setLabelFormat (char f, int prec, int fieldwidth=0) |
const QwtScaleDiv & | scaleDiv () const |
QRect | maxBoundingRect (const QFontMetrics &fm) const |
int | maxWidth (const QPen &pen, const QFontMetrics &fm) const |
int | maxHeight (const QPen &pen, const QFontMetrics &fm) const |
int | minBorderDist (const QFontMetrics &fm) const |
int | minHeight (const QPen &pen, const QFontMetrics &fm) const |
int | minWidth (const QPen &pen, const QFontMetrics &fm) const |
void | labelFormat (char &f, int &prec, int &fieldwidth) const |
virtual void | draw (QPainter *p) const |
virtual QString | label (double) const |
Protected Methods | |
virtual int | maxLabelWidth (const QFontMetrics &) const |
QwtScaleDraw can be used to draw linear or logarithmic scales. A scale has an origin, an orientation and a length, which all can be specified with QwtScaleDraw::setGeometry().
After a scale division has been specified as a QwtScaleDiv object using QwtScaleDraw::setScale(const QwtScaleDiv &s), or determined internally using QwtScaleDraw::setScale(double vmin, double vmax, int maxMajIntv, int maxMinIntv, double step = 0.0, int logarithmic = 0), the scale can be drawn with the QwtScaleDraw::draw() member.
|
Orientation/Position of the scale draw
|
|
Constructor.
The range of the scale is initialized to [0, 100], the angle range is set to [-135, 135], the geometry is initialized such that the origin is at (0,0), the length is 100, and the orientation is QwtScaleDraw::Bottom. |
|
Destructor.
|
|
Draw the scale.
|
|
Convert a value into its representing label using the labelFormat.
|
|
Format character and precision have the same meaning as for the QString class.
|
|
|
|
The bounding rectangle is not very exact for round scales with strange angle ranges.
|
|
|
|
|
|
|
|
Determine the minimum border distance.
This member function returns the minimum space needed to draw the mark labels at the scale's endpoints.
|
|
|
|
|
|
|
|
|
|
Adjust the baseline circle segment for round scales.
The baseline will be drawn from min(angle1,angle2) to max(angle1, angle2). The settings have no effect if the scale orientation is not set to QwtScaleDraw::Round. The default setting is [ -135, 135 ]. An angle of 0 degrees corresponds to the 12 o'clock position, and positive angles count in a clockwise direction.
|
|
Specify the geometry of the scale.
The parameters xorigin, yorigin and length have different meanings, dependent on the orientation:
|
|
Set the number format for the major scale labels.
Format character and precision have the same meaning as for the QString class.
|
|
Adjust the range of the scale.
If step == 0.0, the step width is calculated automatically dependent on the maximal number of scale ticks.
|
|
Change the scale division.
|
|
|
|
|