QwtScaleDraw(3) | Qwt User's Guide | QwtScaleDraw(3) |
QwtScaleDraw - A class for drawing scales.
#include <qwt_scale_draw.h>
Inherits QwtAbstractScaleDraw.
Inherited by QwtDateScaleDraw.
enum Alignment { BottomScale, TopScale,
LeftScale, RightScale }
QwtScaleDraw ()
Constructor. virtual ~QwtScaleDraw ()
Destructor. void getBorderDistHint (const QFont &, int &start,
int &end) const
Determine the minimum border distance. int minLabelDist (const QFont
&) const
int minLength (const QFont &) const
virtual double extent (const QFont &) const
void move (double x, double y)
void move (const QPointF &)
Move the position of the scale. void setLength (double length)
Alignment alignment () const
void setAlignment (Alignment)
Qt::Orientation orientation () const
QPointF pos () const
double length () const
void setLabelAlignment (Qt::Alignment)
Change the label flags. Qt::Alignment labelAlignment () const
void setLabelRotation (double rotation)
double labelRotation () const
int maxLabelHeight (const QFont &) const
int maxLabelWidth (const QFont &) const
QPointF labelPosition (double value) const
QRectF labelRect (const QFont &, double value) const
QSizeF labelSize (const QFont &, double value) const
QRect boundingLabelRect (const QFont &, double value) const
Find the bounding rectangle for the label.
QTransform labelTransformation (const QPointF &, const
QSizeF &) const
virtual void drawTick (QPainter *, double value, double len) const
virtual void drawBackbone (QPainter *) const
virtual void drawLabel (QPainter *, double value) const
A class for drawing scales.
QwtScaleDraw can be used to draw linear or logarithmic scales. A scale has a position, an alignment and a length, which can be specified . The labels can be rotated and aligned to the ticks using setLabelRotation() and setLabelAlignment().
After a scale division has been specified as a QwtScaleDiv object using QwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s), the scale can be drawn with the QwtAbstractScaleDraw::draw() member.
Alignment of the scale draw
See also:
Enumerator
Constructor. The range of the scale is initialized to [0, 100], The position is at (0, 0) with a length of 100. The orientation is QwtAbstractScaleDraw::Bottom.
Return alignment of the scale
See also:
Returns:
Find the bounding rectangle for the label. The coordinates of the rectangle are absolute ( calculated from pos() ). in direction of the tick.
Parameters:
Returns:
See also:
Draws the baseline of the scale
Parameters:
See also:
Implements QwtAbstractScaleDraw.
Draws the label for a major scale tick
Parameters:
See also:
Implements QwtAbstractScaleDraw.
Draw a tick
Parameters:
See also:
Implements QwtAbstractScaleDraw.
Calculate the width/height that is needed for a vertical/horizontal scale.
The extent is calculated from the pen width of the backbone, the major tick length, the spacing and the maximum width/height of the labels.
Parameters:
Returns:
See also:
Implements QwtAbstractScaleDraw.
Determine the minimum border distance. This member function returns the minimum space needed to draw the mark labels at the scale's endpoints.
Parameters:
Returns:
See also:
Find the position, where to paint a label
The position has a distance that depends on the length of the ticks in direction of the alignment().
Parameters:
Returns:
Find the bounding rectangle for the label. The coordinates of the rectangle are relative to spacing + tick length from the backbone in direction of the tick.
Parameters:
Returns:
Returns:
See also:
Calculate the size that is needed to draw a label
Parameters:
Returns:
Calculate the transformation that is needed to paint a label depending on its alignment and rotation.
Parameters:
Returns:
See also:
Returns:
See also:
Parameters:
Returns:
Parameters:
Returns:
Determine the minimum distance between two labels, that is necessary that the texts don't overlap.
Parameters:
Returns:
See also:
Calculate the minimum length that is needed to draw the scale
Parameters:
Returns:
See also:
Move the position of the scale
Parameters:
See also:
Move the position of the scale. The meaning of the parameter pos depends on the alignment:
Parameters:
See also:
Return the orientation
TopScale, BottomScale are horizontal (Qt::Horizontal) scales, LeftScale, RightScale are vertical (Qt::Vertical) scales.
Returns:
See also:
Returns:
See also:
Set the alignment of the scale
Parameters:
The default alignment is QwtScaleDraw::BottomScale
See also:
Change the label flags. Labels are aligned to the point tick length + spacing away from the backbone.
The alignment is relative to the orientation of the label text. In case of an flags of 0 the label will be aligned depending on the orientation of the scale:
QwtScaleDraw::TopScale: Qt::AlignHCenter | Qt::AlignTop QwtScaleDraw::BottomScale: Qt::AlignHCenter | Qt::AlignBottom QwtScaleDraw::LeftScale: Qt::AlignLeft | Qt::AlignVCenter QwtScaleDraw::RightScale: Qt::AlignRight | Qt::AlignVCenter
Changing the alignment is often necessary for rotated labels.
Parameters:
See also:
Warning:
Rotate all labels.
When changing the rotation, it might be necessary to adjust the label flags too. Finding a useful combination is often the result of try and error.
Parameters:
See also:
Set the length of the backbone.
The length doesn't include the space needed for overlapping labels.
Parameters:
See also:
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Wed Jan 2 2019 | Version 6.1.4 |