1
.TH "QwtAbstractScaleDraw" 3 "11 Jun 2007" "Version 5.0.2" "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 54 of file qwt_abstract_scale_draw.cpp.
144
.SS "QwtAbstractScaleDraw::QwtAbstractScaleDraw (const \fBQwtAbstractScaleDraw\fP &)"
148
Definition at line 60 of file qwt_abstract_scale_draw.cpp.
151
.SS "QwtAbstractScaleDraw::~QwtAbstractScaleDraw ()\fC [virtual]\fP"
155
Definition at line 66 of file qwt_abstract_scale_draw.cpp.
156
.SH "Member Function Documentation"
158
.SS "void QwtAbstractScaleDraw::draw (QPainter * painter, const QPalette & palette) const\fC [virtual]\fP"
164
\fIpainter\fP The painter
166
\fIpalette\fP Palette, text color is used for the labels, foreground color for ticks and backbone
171
Definition at line 164 of file qwt_abstract_scale_draw.cpp.
173
Referenced by QwtThermo::draw(), QwtSlider::draw(), and QwtKnob::draw().
174
.SS "virtual void QwtAbstractScaleDraw::drawBackbone (QPainter * painter) const\fC [protected, pure virtual]\fP"
176
Draws the baseline of the scale
180
\fIpainter\fP Painter
185
\fBdrawTick()\fP, \fBdrawLabel()\fP
190
Implemented in \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
191
.SS "virtual void QwtAbstractScaleDraw::drawLabel (QPainter * painter, double value) const\fC [protected, pure virtual]\fP"
193
Draws the label for a major scale tick
197
\fIpainter\fP Painter
204
\fBdrawTick\fP, \fBdrawBackbone\fP
209
Implemented in \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
210
.SS "virtual void QwtAbstractScaleDraw::drawTick (QPainter * painter, double value, int len) const\fC [protected, pure virtual]\fP"
216
\fIpainter\fP Painter
218
\fIvalue\fP Value of the tick
220
\fIlen\fP Lenght of the tick
225
\fBdrawBackbone()\fP, \fBdrawLabel()\fP
230
Implemented in \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
231
.SS "void QwtAbstractScaleDraw::enableComponent (\fBScaleComponent\fP component, bool enable = \fCtrue\fP)"
233
En/Disable a component of the scale
237
\fIcomponent\fP Scale component
244
\fBQwtAbstractScaleDraw::hasComponent\fP
249
Definition at line 85 of file qwt_abstract_scale_draw.cpp.
251
Referenced by QwtDial::setScaleOptions().
252
.SS "virtual int QwtAbstractScaleDraw::extent (const QPen &, const QFont &) const\fC [pure virtual]\fP"
256
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.
260
\fBsetMinimumExtent()\fP, \fBminimumExtent()\fP
265
Implemented in \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
266
.SS "bool QwtAbstractScaleDraw::hasComponent (\fBScaleComponent\fP component) const"
268
Check if a component is enabled
272
\fBQwtAbstractScaleDraw::enableComponent\fP
277
Definition at line 98 of file qwt_abstract_scale_draw.cpp.
279
Referenced by QwtRoundScaleDraw::drawLabel(), QwtScaleDraw::extent(), QwtRoundScaleDraw::extent(), QwtScaleDraw::getBorderDistHint(), QwtScaleDraw::labelPosition(), QwtScaleDraw::minLabelDist(), and QwtScaleDraw::minLength().
280
.SS "void QwtAbstractScaleDraw::invalidateCache ()\fC [protected]\fP"
282
Invalidate the cache used by \fBQwtAbstractScaleDraw::tickLabel\fP
284
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.
286
Definition at line 402 of file qwt_abstract_scale_draw.cpp.
287
.SS "\fBQwtText\fP QwtAbstractScaleDraw::label (double value) const\fC [virtual]\fP"
289
Convert a value into its representing label.
291
The value is converted to a plain text using QString::number(value). This method is often overloaded by applications to have individual labels.
305
Reimplemented in \fBQwtDialScaleDraw\fP.
307
Definition at line 359 of file qwt_abstract_scale_draw.cpp.
309
Referenced by QwtRoundScaleDraw::drawLabel(), QwtRoundScaleDraw::extent(), QwtDialScaleDraw::label(), and tickLabel().
310
.SS "int QwtAbstractScaleDraw::majTickLength () const"
312
The same as QwtAbstractScaleDraw::tickLength(QwtScaleDiv::MajorTick).
314
Definition at line 344 of file qwt_abstract_scale_draw.cpp.
316
Referenced by QwtRoundScaleDraw::drawLabel(), QwtScaleDraw::extent(), and QwtScaleDraw::labelPosition().
317
.SS "const \fBQwtScaleMap\fP & QwtAbstractScaleDraw::map () const"
321
Map how to translate between scale and pixel values
326
Definition at line 125 of file qwt_abstract_scale_draw.cpp.
328
Referenced by QwtRoundScaleDraw::drawBackbone(), QwtScaleWidget::drawColorBar(), QwtRoundScaleDraw::drawLabel(), QwtScaleDraw::drawTick(), QwtRoundScaleDraw::drawTick(), QwtRoundScaleDraw::extent(), QwtScaleDraw::getBorderDistHint(), QwtScaleDraw::labelPosition(), and QwtScaleWidget::setScaleDiv().
329
.SS "int QwtAbstractScaleDraw::minimumExtent () const"
331
Get the minimum extent
335
\fBextent()\fP, \fBsetMinimumExtent()\fP
340
Definition at line 292 of file qwt_abstract_scale_draw.cpp.
342
Referenced by QwtScaleDraw::extent().
343
.SS "\fBQwtAbstractScaleDraw\fP & QwtAbstractScaleDraw::operator= (const \fBQwtAbstractScaleDraw\fP &)"
347
Definition at line 71 of file qwt_abstract_scale_draw.cpp.
350
.SS "const \fBQwtScaleDiv\fP & QwtAbstractScaleDraw::scaleDiv () const"
359
Definition at line 137 of file qwt_abstract_scale_draw.cpp.
361
Referenced by QwtRoundScaleDraw::extent(), QwtScaleDraw::getBorderDistHint(), QwtScaleDraw::maxLabelHeight(), QwtScaleDraw::maxLabelWidth(), QwtScaleDraw::minLabelDist(), QwtScaleDraw::minLength(), QwtScaleWidget::setScaleDiv(), and QwtPlot::sizeHint().
362
.SS "\fBQwtScaleMap\fP & QwtAbstractScaleDraw::scaleMap ()"
366
Map how to translate between scale and pixel values
371
Definition at line 131 of file qwt_abstract_scale_draw.cpp.
373
Referenced by QwtScaleDraw::drawTick(), QwtRoundScaleDraw::QwtRoundScaleDraw(), and QwtRoundScaleDraw::setAngleRange().
374
.SS "void QwtAbstractScaleDraw::setMinimumExtent (int minExtent)"
376
Set a minimum for the extent.
378
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.
382
\fIminExtent\fP Minimum extent
387
\fBextent()\fP, \fBminimumExtent()\fP
392
Definition at line 280 of file qwt_abstract_scale_draw.cpp.
393
.SS "void QwtAbstractScaleDraw::setScaleDiv (const \fBQwtScaleDiv\fP & sd)"
395
Change the scale division
399
\fIsd\fP New scale division
404
Definition at line 107 of file qwt_abstract_scale_draw.cpp.
406
References QwtScaleDiv::hBound(), and QwtScaleDiv::lBound().
408
Referenced by QwtScaleWidget::setScaleDiv().
409
.SS "void QwtAbstractScaleDraw::setSpacing (int spacing)"
411
Set the spacing between tick and labels.
413
The spacing is the distance between ticks and labels. The default spacing is 4 pixels.
417
\fIspacing\fP Spacing
422
\fBQwtAbstractScaleDraw::spacing\fP
427
Definition at line 246 of file qwt_abstract_scale_draw.cpp.
428
.SS "void QwtAbstractScaleDraw::setTickLength (\fBQwtScaleDiv::TickType\fP tickType, int length)"
430
Set the length of the ticks
434
\fItickType\fP Tick type
436
\fIlength\fP New length
441
the length is limited to [0..1000]
446
Definition at line 305 of file qwt_abstract_scale_draw.cpp.
448
Referenced by QwtDial::setScaleTicks().
449
.SS "void QwtAbstractScaleDraw::setTransformation (\fBQwtScaleTransformation\fP * transformation)"
451
Change the transformation of the scale
455
\fItransformation\fP New scale transformation
460
Definition at line 118 of file qwt_abstract_scale_draw.cpp.
462
Referenced by QwtScaleWidget::setScaleDiv().
463
.SS "int QwtAbstractScaleDraw::spacing () const"
467
The spacing is the distance between ticks and labels. The default spacing is 4 pixels.
471
\fBQwtAbstractScaleDraw::setSpacing\fP
476
Definition at line 262 of file qwt_abstract_scale_draw.cpp.
478
Referenced by QwtRoundScaleDraw::drawLabel(), QwtScaleDraw::extent(), and QwtScaleDraw::labelPosition().
479
.SS "const \fBQwtText\fP & QwtAbstractScaleDraw::tickLabel (const QFont & font, double value) const\fC [protected]\fP"
481
Convert a value into its representing label and cache it.
483
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.
499
Definition at line 377 of file qwt_abstract_scale_draw.cpp.
501
References label(), and QwtText::setRenderFlags().
503
Referenced by QwtScaleDraw::drawLabel(), QwtRoundScaleDraw::drawLabel(), QwtRoundScaleDraw::extent(), and QwtScaleDraw::labelRect().
504
.SS "int QwtAbstractScaleDraw::tickLength (\fBQwtScaleDiv::TickType\fP tickType) const"
506
Return the length of the ticks
510
\fBQwtAbstractScaleDraw::setTickLength\fP, \fBQwtAbstractScaleDraw::majTickLength\fP
515
Definition at line 330 of file qwt_abstract_scale_draw.cpp.
519
Generated automatically by Doxygen for Qwt User's Guide from the source code.