1
.TH "QwtAbstractScaleDraw" 3 "24 May 2008" "Version 5.1.1" "Qwt User's Guide" \" -*- nroff -*-
5
QwtAbstractScaleDraw \-
9
Inherited by \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
11
.SH "Detailed Description"
13
A abstract base class for drawing scales.
15
\fBQwtAbstractScaleDraw\fP can be used to draw linear or logarithmic scales.
17
After a scale division has been specified as a \fBQwtScaleDiv\fP object using \fBQwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s)\fP, the scale can be drawn with the \fBQwtAbstractScaleDraw::draw()\fP member.
19
Definition at line 37 of file qwt_abstract_scale_draw.h.
24
.RI "enum \fBScaleComponent\fP { \fBBackbone\fP = 1, \fBTicks\fP = 2, \fBLabels\fP = 4 }"
27
.SS "Public Member Functions"
31
.RI "\fBQwtAbstractScaleDraw\fP ()"
34
.RI "\fBQwtAbstractScaleDraw\fP (const \fBQwtAbstractScaleDraw\fP &)"
37
.RI "virtual \fB~QwtAbstractScaleDraw\fP ()"
40
.RI "\fBQwtAbstractScaleDraw\fP & \fBoperator=\fP (const \fBQwtAbstractScaleDraw\fP &)"
43
.RI "void \fBsetScaleDiv\fP (const \fBQwtScaleDiv\fP &s)"
46
.RI "const \fBQwtScaleDiv\fP & \fBscaleDiv\fP () const"
49
.RI "void \fBsetTransformation\fP (\fBQwtScaleTransformation\fP *)"
52
.RI "const \fBQwtScaleMap\fP & \fBmap\fP () const"
55
.RI "void \fBenableComponent\fP (\fBScaleComponent\fP, bool enable=true)"
58
.RI "bool \fBhasComponent\fP (\fBScaleComponent\fP) const"
61
.RI "void \fBsetTickLength\fP (\fBQwtScaleDiv::TickType\fP, int length)"
64
.RI "int \fBtickLength\fP (\fBQwtScaleDiv::TickType\fP) const"
67
.RI "int \fBmajTickLength\fP () const"
70
.RI "void \fBsetSpacing\fP (int margin)"
73
.RI "int \fBspacing\fP () const"
76
.RI "virtual void \fBdraw\fP (QPainter *, const QPalette &) const"
79
.RI "virtual \fBQwtText\fP \fBlabel\fP (double) const"
82
.RI "virtual int \fBextent\fP (const QPen &, const QFont &) const=0"
85
.RI "void \fBsetMinimumExtent\fP (int)"
88
.RI "int \fBminimumExtent\fP () const"
91
.RI "\fBQwtScaleMap\fP & \fBscaleMap\fP ()"
94
.SS "Protected Member Functions"
98
.RI "virtual void \fBdrawTick\fP (QPainter *painter, double value, int len) const=0"
101
.RI "virtual void \fBdrawBackbone\fP (QPainter *painter) const=0"
104
.RI "virtual void \fBdrawLabel\fP (QPainter *painter, double value) const=0"
107
.RI "void \fBinvalidateCache\fP ()"
110
.RI "const \fBQwtText\fP & \fBtickLabel\fP (const QFont &, double value) const"
113
.SH "Member Enumeration Documentation"
115
.SS "enum \fBQwtAbstractScaleDraw::ScaleComponent\fP"
117
Components of a scale
129
\fBQwtAbstractScaleDraw::enableComponent\fP, \fBQwtAbstractScaleDraw::hasComponent\fP
134
Definition at line 52 of file qwt_abstract_scale_draw.h.
135
.SH "Constructor & Destructor Documentation"
137
.SS "QwtAbstractScaleDraw::QwtAbstractScaleDraw ()"
141
The range of the scale is initialized to [0, 100], The spacing (distance between ticks and labels) is set to 4, the tick lengths are set to 4,6 and 8 pixels
143
Definition at line 55 of file qwt_abstract_scale_draw.cpp.
144
.SS "QwtAbstractScaleDraw::QwtAbstractScaleDraw (const \fBQwtAbstractScaleDraw\fP &)"
148
Definition at line 61 of file qwt_abstract_scale_draw.cpp.
151
.SS "QwtAbstractScaleDraw::~QwtAbstractScaleDraw ()\fC [virtual]\fP"
155
Definition at line 67 of file qwt_abstract_scale_draw.cpp.
156
.SH "Member Function Documentation"
158
.SS "\fBQwtAbstractScaleDraw\fP & QwtAbstractScaleDraw::operator= (const \fBQwtAbstractScaleDraw\fP &)"
162
Definition at line 72 of file qwt_abstract_scale_draw.cpp.
165
.SS "void QwtAbstractScaleDraw::setScaleDiv (const \fBQwtScaleDiv\fP & sd)"
167
Change the scale division
171
\fIsd\fP New scale division
176
Definition at line 108 of file qwt_abstract_scale_draw.cpp.
178
References QwtScaleDiv::hBound(), and QwtScaleDiv::lBound().
180
Referenced by QwtAbstractScale::setAbstractScaleDraw(), QwtScaleWidget::setScaleDiv(), and QwtPlotScaleItem::updateScaleDiv().
181
.SS "const \fBQwtScaleDiv\fP & QwtAbstractScaleDraw::scaleDiv () const"
190
Definition at line 138 of file qwt_abstract_scale_draw.cpp.
192
Referenced by QwtRoundScaleDraw::extent(), QwtScaleDraw::getBorderDistHint(), QwtScaleDraw::maxLabelHeight(), QwtScaleDraw::maxLabelWidth(), QwtScaleDraw::minLabelDist(), QwtScaleDraw::minLength(), QwtScaleWidget::setScaleDiv(), and QwtPlot::sizeHint().
193
.SS "void QwtAbstractScaleDraw::setTransformation (\fBQwtScaleTransformation\fP * transformation)"
195
Change the transformation of the scale
199
\fItransformation\fP New scale transformation
204
Definition at line 119 of file qwt_abstract_scale_draw.cpp.
206
Referenced by QwtPlotScaleItem::draw(), and QwtScaleWidget::setScaleDiv().
207
.SS "const \fBQwtScaleMap\fP & QwtAbstractScaleDraw::map () const"
211
Map how to translate between scale and pixel values
216
Definition at line 126 of file qwt_abstract_scale_draw.cpp.
218
Referenced by QwtRoundScaleDraw::drawBackbone(), QwtScaleWidget::drawColorBar(), QwtRoundScaleDraw::drawLabel(), QwtScaleDraw::drawTick(), QwtRoundScaleDraw::drawTick(), QwtRoundScaleDraw::extent(), QwtScaleDraw::getBorderDistHint(), QwtScaleDraw::labelPosition(), and QwtScaleWidget::setScaleDiv().
219
.SS "void QwtAbstractScaleDraw::enableComponent (\fBScaleComponent\fP component, bool enable = \fCtrue\fP)"
221
En/Disable a component of the scale
225
\fIcomponent\fP Scale component
232
\fBQwtAbstractScaleDraw::hasComponent\fP
237
Definition at line 86 of file qwt_abstract_scale_draw.cpp.
239
Referenced by QwtDial::setScaleOptions().
240
.SS "bool QwtAbstractScaleDraw::hasComponent (\fBScaleComponent\fP component) const"
242
Check if a component is enabled
246
\fBQwtAbstractScaleDraw::enableComponent\fP
251
Definition at line 99 of file qwt_abstract_scale_draw.cpp.
253
Referenced by QwtRoundScaleDraw::drawLabel(), QwtScaleDraw::extent(), QwtRoundScaleDraw::extent(), QwtScaleDraw::getBorderDistHint(), QwtScaleDraw::labelPosition(), QwtScaleDraw::minLabelDist(), and QwtScaleDraw::minLength().
254
.SS "void QwtAbstractScaleDraw::setTickLength (\fBQwtScaleDiv::TickType\fP tickType, int length)"
256
Set the length of the ticks
260
\fItickType\fP Tick type
262
\fIlength\fP New length
267
the length is limited to [0..1000]
272
Definition at line 306 of file qwt_abstract_scale_draw.cpp.
274
Referenced by QwtDial::setScaleTicks().
275
.SS "int QwtAbstractScaleDraw::tickLength (\fBQwtScaleDiv::TickType\fP tickType) const"
277
Return the length of the ticks
281
\fBQwtAbstractScaleDraw::setTickLength\fP, \fBQwtAbstractScaleDraw::majTickLength\fP
286
Definition at line 331 of file qwt_abstract_scale_draw.cpp.
287
.SS "int QwtAbstractScaleDraw::majTickLength () const"
289
The same as QwtAbstractScaleDraw::tickLength(QwtScaleDiv::MajorTick).
291
Definition at line 345 of file qwt_abstract_scale_draw.cpp.
293
Referenced by QwtRoundScaleDraw::drawLabel(), QwtScaleDraw::extent(), QwtRoundScaleDraw::extent(), and QwtScaleDraw::labelPosition().
294
.SS "void QwtAbstractScaleDraw::setSpacing (int spacing)"
296
Set the spacing between tick and labels.
298
The spacing is the distance between ticks and labels. The default spacing is 4 pixels.
302
\fIspacing\fP Spacing
307
\fBQwtAbstractScaleDraw::spacing\fP
312
Definition at line 247 of file qwt_abstract_scale_draw.cpp.
313
.SS "int QwtAbstractScaleDraw::spacing () const"
317
The spacing is the distance between ticks and labels. The default spacing is 4 pixels.
321
\fBQwtAbstractScaleDraw::setSpacing\fP
326
Definition at line 263 of file qwt_abstract_scale_draw.cpp.
328
Referenced by QwtRoundScaleDraw::drawLabel(), QwtScaleDraw::extent(), QwtRoundScaleDraw::extent(), and QwtScaleDraw::labelPosition().
329
.SS "void QwtAbstractScaleDraw::draw (QPainter * painter, const QPalette & palette) const\fC [virtual]\fP"
335
\fIpainter\fP The painter
337
\fIpalette\fP Palette, text color is used for the labels, foreground color for ticks and backbone
342
Definition at line 165 of file qwt_abstract_scale_draw.cpp.
344
Referenced by QwtThermo::draw(), QwtSlider::draw(), QwtPlotScaleItem::draw(), QwtKnob::draw(), and QwtPlot::printScale().
345
.SS "\fBQwtText\fP QwtAbstractScaleDraw::label (double value) const\fC [virtual]\fP"
347
Convert a value into its representing label.
349
The value is converted to a plain text using QLocale::system().toString(value). This method is often overloaded by applications to have individual labels.
363
Reimplemented in \fBQwtDialScaleDraw\fP.
365
Definition at line 361 of file qwt_abstract_scale_draw.cpp.
367
Referenced by QwtRoundScaleDraw::drawLabel(), QwtRoundScaleDraw::extent(), QwtDialScaleDraw::label(), and tickLabel().
368
.SS "virtual int QwtAbstractScaleDraw::extent (const QPen &, const QFont &) const\fC [pure virtual]\fP"
372
The extent is the distcance from the baseline to the outermost pixel of the scale draw in opposite to its orientation. It is at least \fBminimumExtent()\fP pixels.
376
\fBsetMinimumExtent()\fP, \fBminimumExtent()\fP
381
Implemented in \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
382
.SS "void QwtAbstractScaleDraw::setMinimumExtent (int minExtent)"
384
Set a minimum for the extent.
386
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.
390
\fIminExtent\fP Minimum extent
395
\fBextent()\fP, \fBminimumExtent()\fP
400
Definition at line 281 of file qwt_abstract_scale_draw.cpp.
401
.SS "int QwtAbstractScaleDraw::minimumExtent () const"
403
Get the minimum extent
407
\fBextent()\fP, \fBsetMinimumExtent()\fP
412
Definition at line 293 of file qwt_abstract_scale_draw.cpp.
414
Referenced by QwtScaleDraw::extent(), and QwtRoundScaleDraw::extent().
415
.SS "\fBQwtScaleMap\fP & QwtAbstractScaleDraw::scaleMap ()"
419
Map how to translate between scale and pixel values
424
Definition at line 132 of file qwt_abstract_scale_draw.cpp.
426
Referenced by QwtScaleDraw::drawTick(), QwtRoundScaleDraw::QwtRoundScaleDraw(), and QwtRoundScaleDraw::setAngleRange().
427
.SS "virtual void QwtAbstractScaleDraw::drawTick (QPainter * painter, double value, int len) const\fC [protected, pure virtual]\fP"
433
\fIpainter\fP Painter
435
\fIvalue\fP Value of the tick
437
\fIlen\fP Lenght of the tick
442
\fBdrawBackbone()\fP, \fBdrawLabel()\fP
447
Implemented in \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
448
.SS "virtual void QwtAbstractScaleDraw::drawBackbone (QPainter * painter) const\fC [protected, pure virtual]\fP"
450
Draws the baseline of the scale
454
\fIpainter\fP Painter
459
\fBdrawTick()\fP, \fBdrawLabel()\fP
464
Implemented in \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
465
.SS "virtual void QwtAbstractScaleDraw::drawLabel (QPainter * painter, double value) const\fC [protected, pure virtual]\fP"
467
Draws the label for a major scale tick
471
\fIpainter\fP Painter
478
\fBdrawTick\fP, \fBdrawBackbone\fP
483
Implemented in \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
484
.SS "void QwtAbstractScaleDraw::invalidateCache ()\fC [protected]\fP"
486
Invalidate the cache used by \fBQwtAbstractScaleDraw::tickLabel\fP
488
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.
490
Definition at line 404 of file qwt_abstract_scale_draw.cpp.
491
.SS "const \fBQwtText\fP & QwtAbstractScaleDraw::tickLabel (const QFont & font, double value) const\fC [protected]\fP"
493
Convert a value into its representing label and cache it.
495
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.
511
Definition at line 379 of file qwt_abstract_scale_draw.cpp.
513
References label(), and QwtText::setRenderFlags().
515
Referenced by QwtScaleDraw::boundingLabelRect(), QwtScaleDraw::drawLabel(), QwtRoundScaleDraw::drawLabel(), QwtRoundScaleDraw::extent(), and QwtScaleDraw::labelRect().
519
Generated automatically by Doxygen for Qwt User's Guide from the source code.