QwtScaleDraw::AlignmentQwtScaleDraw::alignment()const
Return alignment of the scale
Seealso:setAlignment()Returns:
Alignment of the scale
QRectQwtScaleDraw::boundingLabelRect(constQFont&font,doublevalue)const
Find the bounding rectangle for the label. The coordinates of the rectangle are absolute ( calculated
from pos() ). in direction of the tick.
Parameters:font Font used for painting
value Value
Returns:
Bounding rectangle
Seealso:labelRect()voidQwtScaleDraw::drawBackbone(QPainter*painter)const[protected],[virtual]
Draws the baseline of the scale
Parameters:painter Painter
Seealso:drawTick(), drawLabel()
Implements QwtAbstractScaleDraw.
voidQwtScaleDraw::drawLabel(QPainter*painter,doublevalue)const[protected],[virtual]
Draws the label for a major scale tick
Parameters:painter Painter
value Value
Seealso:drawTick(), drawBackbone(), boundingLabelRect()
Implements QwtAbstractScaleDraw.
voidQwtScaleDraw::drawTick(QPainter*painter,doublevalue,doublelen)const[protected],[virtual]
Draw a tick
Parameters:painter Painter
value Value of the tick
len Length of the tick
Seealso:drawBackbone(), drawLabel()
Implements QwtAbstractScaleDraw.
doubleQwtScaleDraw::extent(constQFont&font)const[virtual]
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:font Font used for painting the labels
Returns:
Extent
Seealso:minLength()
Implements QwtAbstractScaleDraw.
voidQwtScaleDraw::getBorderDistHint(constQFont&font,int&start,int&end)const
Determine the minimum border distance. This member function returns the minimum space needed to draw the
mark labels at the scale's endpoints.
Parameters:font Font
start Start border distance
end End border distance
Qt::AlignmentQwtScaleDraw::labelAlignment()constReturns:
the label flags
Seealso:setLabelAlignment(), labelRotation()QPointFQwtScaleDraw::labelPosition(doublevalue)const
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:value Value
Returns:
Position, where to paint a label
QRectFQwtScaleDraw::labelRect(constQFont&font,doublevalue)const
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:font Font used for painting
value Value
Returns:
Bounding rectangle that is needed to draw a label
doubleQwtScaleDraw::labelRotation()constReturns:
the label rotation
Seealso:setLabelRotation(), labelAlignment()QSizeFQwtScaleDraw::labelSize(constQFont&font,doublevalue)const
Calculate the size that is needed to draw a label
Parameters:font Label font
value Value
Returns:
Size that is needed to draw a label
QTransformQwtScaleDraw::labelTransformation(constQPointF&pos,constQSizeF&size)const[protected]
Calculate the transformation that is needed to paint a label depending on its alignment and rotation.
Parameters:pos Position where to paint the label
size Size of the label
Returns:
Transformation matrix
Seealso:setLabelAlignment(), setLabelRotation()doubleQwtScaleDraw::length()constReturns:
the length of the backbone
Seealso:setLength(), pos()intQwtScaleDraw::maxLabelHeight(constQFont&font)constParameters:font Font
Returns:
the maximum height of a label
intQwtScaleDraw::maxLabelWidth(constQFont&font)constParameters:font Font
Returns:
the maximum width of a label
intQwtScaleDraw::minLabelDist(constQFont&font)const
Determine the minimum distance between two labels, that is necessary that the texts don't overlap.
Parameters:font Font
Returns:
The maximum width of a label
Seealso:getBorderDistHint()intQwtScaleDraw::minLength(constQFont&font)const
Calculate the minimum length that is needed to draw the scale
Parameters:font Font used for painting the labels
Returns:
Minimum length that is needed to draw the scale
Seealso:extent()voidQwtScaleDraw::move(doublex,doubley)[inline]
Move the position of the scale
Parameters:x X coordinate
y Y coordinate
Seealso:move(constQPointF&)voidQwtScaleDraw::move(constQPointF&pos)
Move the position of the scale. The meaning of the parameter pos depends on the alignment:
QwtScaleDraw::LeftScale
The origin is the topmost point of the backbone. The backbone is a vertical line. Scale marks and
labels are drawn at the left of the backbone.
QwtScaleDraw::RightScale
The origin is the topmost point of the backbone. The backbone is a vertical line. Scale marks and
labels are drawn at the right of the backbone.
QwtScaleDraw::TopScale
The origin is the leftmost point of the backbone. The backbone is a horizontal line. Scale marks and
labels are drawn above the backbone.
QwtScaleDraw::BottomScale
The origin is the leftmost point of the backbone. The backbone is a horizontal line Scale marks and
labels are drawn below the backbone.
Parameters:pos Origin of the scale
Seealso:pos(), setLength()Qt::OrientationQwtScaleDraw::orientation()const
Return the orientation
TopScale, BottomScale are horizontal (Qt::Horizontal) scales, LeftScale, RightScale are vertical
(Qt::Vertical) scales.
Returns:
Orientation of the scale
Seealso:alignment()QPointFQwtScaleDraw::pos()constReturns:
Origin of the scale
Seealso:move(), length()voidQwtScaleDraw::setAlignment(Alignmentalign)
Set the alignment of the scale
Parameters:align Alignment of the scale
The default alignment is QwtScaleDraw::BottomScaleSeealso:alignment()voidQwtScaleDraw::setLabelAlignment(Qt::Alignmentalignment)
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:alignment Or'd Qt::AlignmentFlags see <qnamespace.h>
Seealso:setLabelRotation(), labelRotation(), labelAlignment()Warning:
The various alignments might be confusing. The alignment of the label is not the alignment of the
scale and is not the alignment of the flags ( QwtText::flags() ) returned from
QwtAbstractScaleDraw::label().
voidQwtScaleDraw::setLabelRotation(doublerotation)
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:rotation Angle in degrees. When changing the label rotation, the label flags often needs to be
adjusted too.
Seealso:setLabelAlignment(), labelRotation(), labelAlignment().
voidQwtScaleDraw::setLength(doublelength)
Set the length of the backbone.
The length doesn't include the space needed for overlapping labels.
Parameters:length Length of the backbone
Seealso:move(), minLabelDist()