voidQwtAbstractScaleDraw::draw(QPainter*painter,constQPalette&palette)const[virtual]
Draw the scale.
Parameters:painter The painter
palette Palette, text color is used for the labels, foreground color for ticks and backbone
virtualvoidQwtAbstractScaleDraw::drawBackbone(QPainter*painter)const[protected],[purevirtual]
Draws the baseline of the scale
Parameters:painter Painter
Seealso:drawTick(), drawLabel()
Implemented in QwtScaleDraw, and QwtRoundScaleDraw.
virtualvoidQwtAbstractScaleDraw::drawLabel(QPainter*painter,doublevalue)const[protected],[purevirtual]
Draws the label for a major scale tick
Parameters:painter Painter
value Value
Seealso:drawTick(), drawBackbone()
Implemented in QwtScaleDraw, and QwtRoundScaleDraw.
virtualvoidQwtAbstractScaleDraw::drawTick(QPainter*painter,doublevalue,doublelen)const[protected],[purevirtual]
Draw a tick
Parameters:painter Painter
value Value of the tick
len Length of the tick
Seealso:drawBackbone(), drawLabel()
Implemented in QwtScaleDraw, and QwtRoundScaleDraw.
voidQwtAbstractScaleDraw::enableComponent(ScaleComponentcomponent,boolenable=true)
En/Disable a component of the scale
Parameters:component Scale component
enable On/Off
Seealso:hasComponent()virtualdoubleQwtAbstractScaleDraw::extent(constQFont&font)const[purevirtual]
Calculate the extent
The extent is the distance from the baseline to the outermost pixel of the scale draw in opposite to its
orientation. It is at least minimumExtent() pixels.
Parameters:font Font used for drawing the tick labels
Returns:
Number of pixels
Seealso:setMinimumExtent(), minimumExtent()
Implemented in QwtScaleDraw, and QwtRoundScaleDraw.
boolQwtAbstractScaleDraw::hasComponent(ScaleComponentcomponent)const
Check if a component is enabled
Parameters:component Component type
Returns:
true, when component is enabled
Seealso:enableComponent()voidQwtAbstractScaleDraw::invalidateCache()[protected]
Invalidate the cache used by tickLabel()
The cache is invalidated, when a new QwtScaleDiv is set. If the labels need to be changed. while the same
QwtScaleDiv is set, invalidateCache() needs to be called manually.
QwtTextQwtAbstractScaleDraw::label(doublevalue)const[virtual]
Convert a value into its representing label. The value is converted to a plain text using
QLocale().toString(value). This method is often overloaded by applications to have individual labels.
Parameters:value Value
Returns:
Label string.
Reimplemented in QwtDateScaleDraw, and QwtCompassScaleDraw.
doubleQwtAbstractScaleDraw::maxTickLength()constReturns:
Length of the longest tick
Useful for layout calculations
Seealso:tickLength(), setTickLength()doubleQwtAbstractScaleDraw::minimumExtent()const
Get the minimum extent
Returns:
Minimum extent
Seealso:extent(), setMinimumExtent()intQwtAbstractScaleDraw::penWidth()constReturns:
Scale pen width
Seealso:setPenWidth()constQwtScaleDiv&QwtAbstractScaleDraw::scaleDiv()constReturns:
scale division
constQwtScaleMap&QwtAbstractScaleDraw::scaleMap()constReturns:
Map how to translate between scale and pixel values
QwtScaleMap&QwtAbstractScaleDraw::scaleMap()Returns:
Map how to translate between scale and pixel values
voidQwtAbstractScaleDraw::setMinimumExtent(doubleminExtent)
Set a minimum for the extent. The extent is calculated from the components of the scale draw. In
situations, where the labels are changing and the layout depends on the extent (f.e scrolling a scale),
setting an upper limit as minimum extent will avoid jumps of the layout.
Parameters:minExtent Minimum extent
Seealso:extent(), minimumExtent()voidQwtAbstractScaleDraw::setPenWidth(intwidth)
Specify the width of the scale pen.
Parameters:width Pen width
Seealso:penWidth()voidQwtAbstractScaleDraw::setScaleDiv(constQwtScaleDiv&scaleDiv)
Change the scale division
Parameters:scaleDiv New scale division
voidQwtAbstractScaleDraw::setSpacing(doublespacing)
Set the spacing between tick and labels. The spacing is the distance between ticks and labels. The
default spacing is 4 pixels.
Parameters:spacing Spacing
Seealso:spacing()voidQwtAbstractScaleDraw::setTickLength(QwtScaleDiv::TickTypetickType,doublelength)
Set the length of the ticks
Parameters:tickType Tick type
length New length
Warning:
the length is limited to [0..1000]
voidQwtAbstractScaleDraw::setTransformation(QwtTransform*transformation)
Change the transformation of the scale
Parameters:transformation New scale transformation
doubleQwtAbstractScaleDraw::spacing()const
Get the spacing. The spacing is the distance between ticks and labels. The default spacing is 4 pixels.
Returns:
Spacing
Seealso:setSpacing()constQwtText&QwtAbstractScaleDraw::tickLabel(constQFont&font,doublevalue)const[protected]
Convert a value into its representing label and cache it. The conversion between value and label is
called very often in the layout and painting code. Unfortunately the calculation of the label sizes might
be slow (really slow for rich text in Qt4), so it's necessary to cache the labels.
Parameters:font Font
value Value
Returns:
Tick label
doubleQwtAbstractScaleDraw::tickLength(QwtScaleDiv::TickTypetickType)constReturns:
Length of the ticks
Seealso:setTickLength(), maxTickLength()