.TH "QwtDialScaleDraw" 3 "Mon Aug 1 2011" "Version 5.2.2" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtDialScaleDraw \- .PP A special scale draw made for \fBQwtDial\fP. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBQwtRoundScaleDraw\fP. .SS "Public Types" .in +1c .ti -1c .RI "enum \fBScaleComponent\fP { \fBBackbone\fP = 1, \fBTicks\fP = 2, \fBLabels\fP = 4 }" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "QPoint \fBcenter\fP () const " .br .ti -1c .RI "virtual void \fBdraw\fP (QPainter *, const QPalette &) const " .br .ti -1c .RI "void \fBenableComponent\fP (\fBScaleComponent\fP, bool enable=true)" .br .ti -1c .RI "virtual int \fBextent\fP (const QPen &, const QFont &) const " .br .ti -1c .RI "bool \fBhasComponent\fP (\fBScaleComponent\fP) const " .br .ti -1c .RI "virtual \fBQwtText\fP \fBlabel\fP (double value) const " .br .ti -1c .RI "int \fBmajTickLength\fP () const " .br .ti -1c .RI "const \fBQwtScaleMap\fP & \fBmap\fP () const " .br .ti -1c .RI "int \fBminimumExtent\fP () const " .br .ti -1c .RI "void \fBmoveCenter\fP (const QPoint &)" .br .ti -1c .RI "void \fBmoveCenter\fP (int x, int y)" .br .ti -1c .RI "uint \fBpenWidth\fP () const " .br .ti -1c .RI "\fBQwtDialScaleDraw\fP (\fBQwtDial\fP *)" .br .ti -1c .RI "int \fBradius\fP () const " .br .ti -1c .RI "const \fBQwtScaleDiv\fP & \fBscaleDiv\fP () const " .br .ti -1c .RI "\fBQwtScaleMap\fP & \fBscaleMap\fP ()" .br .ti -1c .RI "void \fBsetAngleRange\fP (double angle1, double angle2)" .br .ti -1c .RI "void \fBsetMinimumExtent\fP (int)" .br .ti -1c .RI "void \fBsetPenWidth\fP (uint)" .br .ti -1c .RI "void \fBsetRadius\fP (int radius)" .br .ti -1c .RI "void \fBsetScaleDiv\fP (const \fBQwtScaleDiv\fP &s)" .br .ti -1c .RI "void \fBsetSpacing\fP (int margin)" .br .ti -1c .RI "void \fBsetTickLength\fP (\fBQwtScaleDiv::TickType\fP, int length)" .br .ti -1c .RI "void \fBsetTransformation\fP (\fBQwtScaleTransformation\fP *)" .br .ti -1c .RI "int \fBspacing\fP () const " .br .ti -1c .RI "int \fBtickLength\fP (\fBQwtScaleDiv::TickType\fP) const " .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual void \fBdrawBackbone\fP (QPainter *p) const " .br .ti -1c .RI "virtual void \fBdrawLabel\fP (QPainter *p, double val) const " .br .ti -1c .RI "virtual void \fBdrawTick\fP (QPainter *p, double val, int len) const " .br .ti -1c .RI "void \fBinvalidateCache\fP ()" .br .ti -1c .RI "const \fBQwtText\fP & \fBtickLabel\fP (const QFont &, double value) const " .br .in -1c .SH "Detailed Description" .PP A special scale draw made for \fBQwtDial\fP. \fBSee also:\fP .RS 4 \fBQwtDial\fP, \fBQwtCompass\fP .RE .PP .SH "Member Enumeration Documentation" .PP .SS "enum \fBQwtAbstractScaleDraw::ScaleComponent\fP\fC [inherited]\fP"Components of a scale .PP .IP "\(bu" 2 Backbone .IP "\(bu" 2 Ticks .IP "\(bu" 2 Labels .PP .PP \fBSee also:\fP .RS 4 \fBenableComponent()\fP, \fBhasComponent\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "QwtDialScaleDraw::QwtDialScaleDraw (\fBQwtDial\fP *parent)\fC [explicit]\fP"Constructor .PP \fBParameters:\fP .RS 4 \fIparent\fP Parent dial widget .RE .PP .SH "Member Function Documentation" .PP .SS "QPoint QwtRoundScaleDraw::center () const\fC [inherited]\fP" .PP Get the center of the scale. .SS "void QwtAbstractScaleDraw::draw (QPainter *painter, const QPalette &palette) const\fC [virtual, inherited]\fP" .PP Draw the scale. \fBParameters:\fP .RS 4 \fIpainter\fP The painter .br \fIpalette\fP Palette, text color is used for the labels, foreground color for ticks and backbone .RE .PP .SS "void QwtRoundScaleDraw::drawBackbone (QPainter *painter) const\fC [protected, virtual, inherited]\fP"Draws the baseline of the scale .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .RE .PP \fBSee also:\fP .RS 4 \fBdrawTick()\fP, \fBdrawLabel()\fP .RE .PP .PP Implements \fBQwtAbstractScaleDraw\fP. .SS "void QwtRoundScaleDraw::drawLabel (QPainter *painter, doublevalue) const\fC [protected, virtual, inherited]\fP"Draws the label for a major scale tick .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIvalue\fP Value .RE .PP \fBSee also:\fP .RS 4 \fBdrawTick()\fP, \fBdrawBackbone()\fP .RE .PP .PP Implements \fBQwtAbstractScaleDraw\fP. .SS "void QwtRoundScaleDraw::drawTick (QPainter *painter, doublevalue, intlen) const\fC [protected, virtual, inherited]\fP"Draw a tick .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIvalue\fP Value of the tick .br \fIlen\fP Length of the tick .RE .PP \fBSee also:\fP .RS 4 \fBdrawBackbone()\fP, \fBdrawLabel()\fP .RE .PP .PP Implements \fBQwtAbstractScaleDraw\fP. .SS "void QwtAbstractScaleDraw::enableComponent (\fBScaleComponent\fPcomponent, boolenable = \fCtrue\fP)\fC [inherited]\fP"En/Disable a component of the scale .PP \fBParameters:\fP .RS 4 \fIcomponent\fP Scale component .br \fIenable\fP On/Off .RE .PP \fBSee also:\fP .RS 4 \fBhasComponent()\fP .RE .PP .SS "int QwtRoundScaleDraw::extent (const QPen &pen, const QFont &font) const\fC [virtual, inherited]\fP"Calculate the extent of the scale .PP The extent is the distcance between the baseline to the outermost pixel of the scale draw. \fBradius()\fP + \fBextent()\fP is an upper limit for the radius of the bounding circle. .PP \fBParameters:\fP .RS 4 \fIpen\fP Pen that is used for painting backbone and ticks .br \fIfont\fP Font used for painting the labels .RE .PP \fBSee also:\fP .RS 4 \fBsetMinimumExtent()\fP, \fBminimumExtent()\fP .RE .PP \fBWarning:\fP .RS 4 The implemented algo is not too smart and calculates only an upper limit, that might be a few pixels too large .RE .PP .PP Implements \fBQwtAbstractScaleDraw\fP. .SS "bool QwtAbstractScaleDraw::hasComponent (\fBScaleComponent\fPcomponent) const\fC [inherited]\fP"Check if a component is enabled .PP \fBSee also:\fP .RS 4 \fBenableComponent()\fP .RE .PP .SS "void QwtAbstractScaleDraw::invalidateCache ()\fC [protected, inherited]\fP"Invalidate the cache used by \fBQwtAbstractScaleDraw::tickLabel\fP .PP The cache is invalidated, when a new \fBQwtScaleDiv\fP is set. If the labels need to be changed. while the same \fBQwtScaleDiv\fP is set, \fBQwtAbstractScaleDraw::invalidateCache\fP needs to be called manually. .SS "\fBQwtText\fP QwtDialScaleDraw::label (doublevalue) const\fC [virtual]\fP"Call \fBQwtDial::scaleLabel\fP of the parent dial widget. .PP \fBParameters:\fP .RS 4 \fIvalue\fP Value to display .RE .PP \fBSee also:\fP .RS 4 \fBQwtDial::scaleLabel()\fP .RE .PP .PP Reimplemented from \fBQwtAbstractScaleDraw\fP. .SS "int QwtAbstractScaleDraw::majTickLength () const\fC [inherited]\fP"The same as QwtAbstractScaleDraw::tickLength(QwtScaleDiv::MajorTick). .SS "const \fBQwtScaleMap\fP & QwtAbstractScaleDraw::map () const\fC [inherited]\fP"\fBReturns:\fP .RS 4 Map how to translate between scale and pixel values .RE .PP .SS "int QwtAbstractScaleDraw::minimumExtent () const\fC [inherited]\fP"Get the minimum extent .PP \fBSee also:\fP .RS 4 \fBextent()\fP, \fBsetMinimumExtent()\fP .RE .PP .SS "void QwtRoundScaleDraw::moveCenter (intx, inty)\fC [inline, inherited]\fP" .PP Move the center of the scale draw, leaving the radius unchanged. .SS "void QwtRoundScaleDraw::moveCenter (const QPoint ¢er)\fC [inherited]\fP"Move the center of the scale draw, leaving the radius unchanged .PP \fBParameters:\fP .RS 4 \fIcenter\fP New center .RE .PP \fBSee also:\fP .RS 4 \fBsetRadius()\fP .RE .PP .SS "uint QwtDialScaleDraw::penWidth () const"\fBReturns:\fP .RS 4 Pen width used for painting the scale .RE .PP \fBSee also:\fP .RS 4 \fBsetPenWidth\fP, \fBQwtDial::drawScale()\fP .RE .PP .SS "int QwtRoundScaleDraw::radius () const\fC [inherited]\fP"Get the radius .PP Radius is the radius of the backbone without ticks and labels. .PP \fBSee also:\fP .RS 4 \fBsetRadius()\fP, \fBextent()\fP .RE .PP .SS "const \fBQwtScaleDiv\fP & QwtAbstractScaleDraw::scaleDiv () const\fC [inherited]\fP"\fBReturns:\fP .RS 4 scale division .RE .PP .SS "\fBQwtScaleMap\fP & QwtAbstractScaleDraw::scaleMap ()\fC [inherited]\fP"\fBReturns:\fP .RS 4 Map how to translate between scale and pixel values .RE .PP .SS "void QwtRoundScaleDraw::setAngleRange (doubleangle1, doubleangle2)\fC [inherited]\fP" .PP Adjust the baseline circle segment for round scales. The baseline will be drawn from min(angle1,angle2) to max(angle1, angle2). 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. .PP \fBParameters:\fP .RS 4 \fIangle1\fP .br \fIangle2\fP boundaries of the angle interval in degrees. .RE .PP \fBWarning:\fP .RS 4 .PD 0 .IP "\(bu" 2 The angle range is limited to [\-360, 360] degrees. Angles exceeding this range will be clipped. .IP "\(bu" 2 For angles more than 359 degrees above or below min(angle1, angle2), scale marks will not be drawn. .IP "\(bu" 2 If you need a counterclockwise scale, use QwtScaleDiv::setRange .PP .RE .PP .SS "void QwtAbstractScaleDraw::setMinimumExtent (intminExtent)\fC [inherited]\fP" .PP Set a minimum for the extent. The extent is calculated from the coomponents 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. .PP \fBParameters:\fP .RS 4 \fIminExtent\fP Minimum extent .RE .PP \fBSee also:\fP .RS 4 \fBextent()\fP, \fBminimumExtent()\fP .RE .PP .SS "void QwtDialScaleDraw::setPenWidth (uintpenWidth)"Set the pen width used for painting the scale .PP \fBParameters:\fP .RS 4 \fIpenWidth\fP Pen width .RE .PP \fBSee also:\fP .RS 4 \fBpenWidth()\fP, \fBQwtDial::drawScale()\fP .RE .PP .SS "void QwtRoundScaleDraw::setRadius (intradius)\fC [inherited]\fP"Change of radius the scale .PP Radius is the radius of the backbone without ticks and labels. .PP \fBParameters:\fP .RS 4 \fIradius\fP New Radius .RE .PP \fBSee also:\fP .RS 4 \fBmoveCenter()\fP .RE .PP .SS "void QwtAbstractScaleDraw::setScaleDiv (const \fBQwtScaleDiv\fP &sd)\fC [inherited]\fP"Change the scale division .PP \fBParameters:\fP .RS 4 \fIsd\fP New scale division .RE .PP .SS "void QwtAbstractScaleDraw::setSpacing (intspacing)\fC [inherited]\fP" .PP Set the spacing between tick and labels. The spacing is the distance between ticks and labels. The default spacing is 4 pixels. .PP \fBParameters:\fP .RS 4 \fIspacing\fP Spacing .RE .PP \fBSee also:\fP .RS 4 \fBspacing()\fP .RE .PP .SS "void QwtAbstractScaleDraw::setTickLength (\fBQwtScaleDiv::TickType\fPtickType, intlength)\fC [inherited]\fP"Set the length of the ticks .PP \fBParameters:\fP .RS 4 \fItickType\fP Tick type .br \fIlength\fP New length .RE .PP \fBWarning:\fP .RS 4 the length is limited to [0..1000] .RE .PP .SS "void QwtAbstractScaleDraw::setTransformation (\fBQwtScaleTransformation\fP *transformation)\fC [inherited]\fP"Change the transformation of the scale .PP \fBParameters:\fP .RS 4 \fItransformation\fP New scale transformation .RE .PP .SS "int QwtAbstractScaleDraw::spacing () const\fC [inherited]\fP" .PP Get the spacing. The spacing is the distance between ticks and labels. The default spacing is 4 pixels. .PP \fBSee also:\fP .RS 4 \fBsetSpacing()\fP .RE .PP .SS "const \fBQwtText\fP & QwtAbstractScaleDraw::tickLabel (const QFont &font, doublevalue) const\fC [protected, inherited]\fP" .PP 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. .PP \fBParameters:\fP .RS 4 \fIfont\fP Font .br \fIvalue\fP Value .RE .PP \fBReturns:\fP .RS 4 Tick label .RE .PP .SS "int QwtAbstractScaleDraw::tickLength (\fBQwtScaleDiv::TickType\fPtickType) const\fC [inherited]\fP"Return the length of the ticks .PP \fBSee also:\fP .RS 4 \fBsetTickLength()\fP, \fBmajTickLength()\fP .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Qwt User's Guide from the source code.