~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to qwt/doc/man/man3/QwtScaleDraw.3

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2011-06-10 11:22:47 UTC
  • mfrom: (1.1.6 upstream) (2.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110610112247-0i1019vvmzaq6p86
Tags: 6.0.0-1
* New upstream release (Closes: #624107):
  - drop Qt3 support. (Closes: #604379, #626868)
* Register documentation with doc-base. (Closes: #626567)
* Drop patches:
  - 01_makefiles.diff
  - 02_add_missing_warnings.diff
  - 03_qwt_branch_pull_r544.diff
* Add qwt_install_paths.patch to fix the hardcoded installation paths.
* Update debian/control:
  - drop libqt3-mt-dev build dependency.
  - bump Standards-Version to 3.9.2 (no changes).
  - drop Qt3 related packages.
  - due to bump soname (and as we dropper Qt3 support):
    - libqwt5-qt4-dev -> libqwt-dev
    - libqwt5-qt4 -> libqwt6
    - libqwt5-doc -> libqwt-doc
* Update debian/copyright file.
* Update debian/rules: drop Qt3 packages support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH "QwtScaleDraw" 3 "22 Mar 2009" "Qwt User's Guide" \" -*- nroff -*-
2
 
.ad l
3
 
.nh
4
 
.SH NAME
5
 
QwtScaleDraw \- A class for drawing scales.  
6
 
 
7
 
.PP
8
 
.SH SYNOPSIS
9
 
.br
10
 
.PP
11
 
\fC#include <qwt_scale_draw.h>\fP
12
 
.PP
13
 
Inherits \fBQwtAbstractScaleDraw\fP.
14
 
.PP
15
 
.SS "Public Types"
16
 
 
17
 
.in +1c
18
 
.ti -1c
19
 
.RI "enum \fBAlignment\fP { \fBBottomScale\fP, \fBTopScale\fP, \fBLeftScale\fP, \fBRightScale\fP }"
20
 
.br
21
 
.SS "Public Member Functions"
22
 
 
23
 
.in +1c
24
 
.ti -1c
25
 
.RI "\fBQwtScaleDraw\fP ()"
26
 
.br
27
 
.ti -1c
28
 
.RI "\fBQwtScaleDraw\fP (const \fBQwtScaleDraw\fP &)"
29
 
.br
30
 
.ti -1c
31
 
.RI "virtual \fB~QwtScaleDraw\fP ()"
32
 
.br
33
 
.ti -1c
34
 
.RI "\fBQwtScaleDraw\fP & \fBoperator=\fP (const \fBQwtScaleDraw\fP &other)"
35
 
.br
36
 
.ti -1c
37
 
.RI "void \fBgetBorderDistHint\fP (const QFont &, int &start, int &end) const "
38
 
.br
39
 
.ti -1c
40
 
.RI "int \fBminLabelDist\fP (const QFont &) const "
41
 
.br
42
 
.ti -1c
43
 
.RI "int \fBminLength\fP (const QPen &, const QFont &) const "
44
 
.br
45
 
.ti -1c
46
 
.RI "virtual int \fBextent\fP (const QPen &, const QFont &) const "
47
 
.br
48
 
.ti -1c
49
 
.RI "void \fBmove\fP (int x, int y)"
50
 
.br
51
 
.ti -1c
52
 
.RI "void \fBmove\fP (const QPoint &)"
53
 
.br
54
 
.ti -1c
55
 
.RI "void \fBsetLength\fP (int length)"
56
 
.br
57
 
.ti -1c
58
 
.RI "\fBAlignment\fP \fBalignment\fP () const "
59
 
.br
60
 
.ti -1c
61
 
.RI "void \fBsetAlignment\fP (\fBAlignment\fP)"
62
 
.br
63
 
.ti -1c
64
 
.RI "Qt::Orientation \fBorientation\fP () const "
65
 
.br
66
 
.ti -1c
67
 
.RI "QPoint \fBpos\fP () const "
68
 
.br
69
 
.ti -1c
70
 
.RI "int \fBlength\fP () const "
71
 
.br
72
 
.ti -1c
73
 
.RI "void \fBsetLabelAlignment\fP (Qt::Alignment)"
74
 
.br
75
 
.ti -1c
76
 
.RI "Qt::Alignment \fBlabelAlignment\fP () const "
77
 
.br
78
 
.ti -1c
79
 
.RI "void \fBsetLabelRotation\fP (double rotation)"
80
 
.br
81
 
.ti -1c
82
 
.RI "double \fBlabelRotation\fP () const "
83
 
.br
84
 
.ti -1c
85
 
.RI "int \fBmaxLabelHeight\fP (const QFont &) const "
86
 
.br
87
 
.ti -1c
88
 
.RI "int \fBmaxLabelWidth\fP (const QFont &) const "
89
 
.br
90
 
.ti -1c
91
 
.RI "QPoint \fBlabelPosition\fP (double val) const "
92
 
.br
93
 
.ti -1c
94
 
.RI "QRect \fBlabelRect\fP (const QFont &, double val) const "
95
 
.br
96
 
.ti -1c
97
 
.RI "QSize \fBlabelSize\fP (const QFont &, double val) const "
98
 
.br
99
 
.ti -1c
100
 
.RI "QRect \fBboundingLabelRect\fP (const QFont &, double val) const "
101
 
.br
102
 
.in -1c
103
 
.SS "Protected Member Functions"
104
 
 
105
 
.in +1c
106
 
.ti -1c
107
 
.RI "QMatrix \fBlabelMatrix\fP (const QPoint &, const QSize &) const "
108
 
.br
109
 
.ti -1c
110
 
.RI "virtual void \fBdrawTick\fP (QPainter *p, double val, int len) const "
111
 
.br
112
 
.ti -1c
113
 
.RI "virtual void \fBdrawBackbone\fP (QPainter *p) const "
114
 
.br
115
 
.ti -1c
116
 
.RI "virtual void \fBdrawLabel\fP (QPainter *p, double val) const "
117
 
.br
118
 
.in -1c
119
 
.SH "Detailed Description"
120
 
.PP 
121
 
A class for drawing scales. 
122
 
 
123
 
\fBQwtScaleDraw\fP can be used to draw linear or logarithmic scales. A scale has a position, an alignment and a length, which can be specified . The labels can be rotated and aligned to the ticks using \fBsetLabelRotation()\fP and \fBsetLabelAlignment()\fP.
124
 
.PP
125
 
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. 
126
 
.SH "Member Enumeration Documentation"
127
 
.PP 
128
 
.SS "enum \fBQwtScaleDraw::Alignment\fP"
129
 
.PP
130
 
Alignment of the scale draw 
131
 
.PP
132
 
\fBSee also:\fP
133
 
.RS 4
134
 
\fBsetAlignment()\fP, \fBalignment()\fP 
135
 
.RE
136
 
.PP
137
 
 
138
 
.SH "Constructor & Destructor Documentation"
139
 
.PP 
140
 
.SS "QwtScaleDraw::QwtScaleDraw ()"
141
 
.PP
142
 
Constructor. 
143
 
.PP
144
 
The range of the scale is initialized to [0, 100], The position is at (0, 0) with a length of 100. The orientation is QwtAbstractScaleDraw::Bottom. 
145
 
.SS "QwtScaleDraw::QwtScaleDraw (const \fBQwtScaleDraw\fP & other)"
146
 
.PP
147
 
Copy constructor. 
148
 
.PP
149
 
.SS "QwtScaleDraw::~QwtScaleDraw ()\fC [virtual]\fP"
150
 
.PP
151
 
Destructor. 
152
 
.PP
153
 
.SH "Member Function Documentation"
154
 
.PP 
155
 
.SS "\fBQwtScaleDraw::Alignment\fP QwtScaleDraw::alignment () const"
156
 
.PP
157
 
Return alignment of the scale 
158
 
.PP
159
 
\fBSee also:\fP
160
 
.RS 4
161
 
\fBsetAlignment()\fP 
162
 
.RE
163
 
.PP
164
 
 
165
 
.SS "QRect QwtScaleDraw::boundingLabelRect (const QFont & font, double value) const"
166
 
.PP
167
 
Find the bounding rect for the label. The coordinates of the rect are absolute coordinates ( calculated from \fBpos()\fP ). in direction of the tick.
168
 
.PP
169
 
\fBParameters:\fP
170
 
.RS 4
171
 
\fIfont\fP Font used for painting 
172
 
.br
173
 
\fIvalue\fP Value
174
 
.RE
175
 
.PP
176
 
\fBSee also:\fP
177
 
.RS 4
178
 
\fBlabelRect()\fP 
179
 
.RE
180
 
.PP
181
 
 
182
 
.SS "void QwtScaleDraw::drawBackbone (QPainter * painter) const\fC [protected, virtual]\fP"
183
 
.PP
184
 
Draws the baseline of the scale 
185
 
.PP
186
 
\fBParameters:\fP
187
 
.RS 4
188
 
\fIpainter\fP Painter
189
 
.RE
190
 
.PP
191
 
\fBSee also:\fP
192
 
.RS 4
193
 
\fBdrawTick()\fP, \fBdrawLabel()\fP 
194
 
.RE
195
 
.PP
196
 
 
197
 
.PP
198
 
Implements \fBQwtAbstractScaleDraw\fP.
199
 
.SS "void QwtScaleDraw::drawLabel (QPainter * painter, double value) const\fC [protected, virtual]\fP"
200
 
.PP
201
 
Draws the label for a major scale tick
202
 
.PP
203
 
\fBParameters:\fP
204
 
.RS 4
205
 
\fIpainter\fP Painter 
206
 
.br
207
 
\fIvalue\fP Value
208
 
.RE
209
 
.PP
210
 
\fBSee also:\fP
211
 
.RS 4
212
 
\fBdrawTick()\fP, \fBdrawBackbone()\fP, \fBboundingLabelRect()\fP 
213
 
.RE
214
 
.PP
215
 
 
216
 
.PP
217
 
Implements \fBQwtAbstractScaleDraw\fP.
218
 
.SS "void QwtScaleDraw::drawTick (QPainter * painter, double value, int len) const\fC [protected, virtual]\fP"
219
 
.PP
220
 
Draw a tick
221
 
.PP
222
 
\fBParameters:\fP
223
 
.RS 4
224
 
\fIpainter\fP Painter 
225
 
.br
226
 
\fIvalue\fP Value of the tick 
227
 
.br
228
 
\fIlen\fP Lenght of the tick
229
 
.RE
230
 
.PP
231
 
\fBSee also:\fP
232
 
.RS 4
233
 
\fBdrawBackbone()\fP, \fBdrawLabel()\fP 
234
 
.RE
235
 
.PP
236
 
 
237
 
.PP
238
 
Implements \fBQwtAbstractScaleDraw\fP.
239
 
.SS "int QwtScaleDraw::extent (const QPen & pen, const QFont & font) const\fC [virtual]\fP"
240
 
.PP
241
 
Calculate the width/height that is needed for a vertical/horizontal scale.
242
 
.PP
243
 
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.
244
 
.PP
245
 
\fBParameters:\fP
246
 
.RS 4
247
 
\fIpen\fP Pen that is used for painting backbone and ticks 
248
 
.br
249
 
\fIfont\fP Font used for painting the labels
250
 
.RE
251
 
.PP
252
 
\fBSee also:\fP
253
 
.RS 4
254
 
\fBminLength()\fP 
255
 
.RE
256
 
.PP
257
 
 
258
 
.PP
259
 
Implements \fBQwtAbstractScaleDraw\fP.
260
 
.SS "void QwtScaleDraw::getBorderDistHint (const QFont & font, int & start, int & end) const"
261
 
.PP
262
 
Determine the minimum border distance. 
263
 
.PP
264
 
This member function returns the minimum space needed to draw the mark labels at the scale's endpoints.
265
 
.PP
266
 
\fBParameters:\fP
267
 
.RS 4
268
 
\fIfont\fP Font 
269
 
.br
270
 
\fIstart\fP Start border distance 
271
 
.br
272
 
\fIend\fP End border distance 
273
 
.RE
274
 
.PP
275
 
 
276
 
.SS "Qt::Alignment QwtScaleDraw::labelAlignment () const"
277
 
.PP
278
 
\fBReturns:\fP
279
 
.RS 4
280
 
the label flags 
281
 
.RE
282
 
.PP
283
 
\fBSee also:\fP
284
 
.RS 4
285
 
\fBsetLabelAlignment()\fP, \fBlabelRotation()\fP 
286
 
.RE
287
 
.PP
288
 
 
289
 
.SS "QMatrix QwtScaleDraw::labelMatrix (const QPoint & pos, const QSize & size) const\fC [protected]\fP"
290
 
.PP
291
 
Calculate the matrix that is needed to paint a label depending on its alignment and rotation.
292
 
.PP
293
 
\fBParameters:\fP
294
 
.RS 4
295
 
\fIpos\fP Position where to paint the label 
296
 
.br
297
 
\fIsize\fP Size of the label
298
 
.RE
299
 
.PP
300
 
\fBSee also:\fP
301
 
.RS 4
302
 
\fBsetLabelAlignment()\fP, \fBsetLabelRotation()\fP 
303
 
.RE
304
 
.PP
305
 
 
306
 
.SS "QPoint QwtScaleDraw::labelPosition (double value) const"
307
 
.PP
308
 
Find the position, where to paint a label
309
 
.PP
310
 
The position has a distance of \fBmajTickLength()\fP + \fBspacing()\fP + 1 from the backbone. The direction depends on the \fBalignment()\fP
311
 
.PP
312
 
\fBParameters:\fP
313
 
.RS 4
314
 
\fIvalue\fP Value 
315
 
.RE
316
 
.PP
317
 
 
318
 
.SS "QRect QwtScaleDraw::labelRect (const QFont & font, double value) const"
319
 
.PP
320
 
Find the bounding rect for the label. The coordinates of the rect are relative to spacing + ticklength from the backbone in direction of the tick.
321
 
.PP
322
 
\fBParameters:\fP
323
 
.RS 4
324
 
\fIfont\fP Font used for painting 
325
 
.br
326
 
\fIvalue\fP Value 
327
 
.RE
328
 
.PP
329
 
 
330
 
.SS "double QwtScaleDraw::labelRotation () const"
331
 
.PP
332
 
\fBReturns:\fP
333
 
.RS 4
334
 
the label rotation 
335
 
.RE
336
 
.PP
337
 
\fBSee also:\fP
338
 
.RS 4
339
 
\fBsetLabelRotation()\fP, \fBlabelAlignment()\fP 
340
 
.RE
341
 
.PP
342
 
 
343
 
.SS "QSize QwtScaleDraw::labelSize (const QFont & font, double value) const"
344
 
.PP
345
 
Calculate the size that is needed to draw a label
346
 
.PP
347
 
\fBParameters:\fP
348
 
.RS 4
349
 
\fIfont\fP Label font 
350
 
.br
351
 
\fIvalue\fP Value 
352
 
.RE
353
 
.PP
354
 
 
355
 
.SS "int QwtScaleDraw::length () const"
356
 
.PP
357
 
\fBReturns:\fP
358
 
.RS 4
359
 
the length of the backbone 
360
 
.RE
361
 
.PP
362
 
\fBSee also:\fP
363
 
.RS 4
364
 
\fBsetLength()\fP, \fBpos()\fP 
365
 
.RE
366
 
.PP
367
 
 
368
 
.SS "int QwtScaleDraw::maxLabelHeight (const QFont & font) const"
369
 
.PP
370
 
\fBParameters:\fP
371
 
.RS 4
372
 
\fIfont\fP Font 
373
 
.RE
374
 
.PP
375
 
\fBReturns:\fP
376
 
.RS 4
377
 
the maximum height of a label 
378
 
.RE
379
 
.PP
380
 
 
381
 
.SS "int QwtScaleDraw::maxLabelWidth (const QFont & font) const"
382
 
.PP
383
 
\fBParameters:\fP
384
 
.RS 4
385
 
\fIfont\fP Font 
386
 
.RE
387
 
.PP
388
 
\fBReturns:\fP
389
 
.RS 4
390
 
the maximum width of a label 
391
 
.RE
392
 
.PP
393
 
 
394
 
.SS "int QwtScaleDraw::minLabelDist (const QFont & font) const"
395
 
.PP
396
 
Determine the minimum distance between two labels, that is necessary that the texts don't overlap.
397
 
.PP
398
 
\fBParameters:\fP
399
 
.RS 4
400
 
\fIfont\fP Font 
401
 
.RE
402
 
.PP
403
 
\fBReturns:\fP
404
 
.RS 4
405
 
The maximum width of a label
406
 
.RE
407
 
.PP
408
 
\fBSee also:\fP
409
 
.RS 4
410
 
\fBgetBorderDistHint()\fP 
411
 
.RE
412
 
.PP
413
 
 
414
 
.SS "int QwtScaleDraw::minLength (const QPen & pen, const QFont & font) const"
415
 
.PP
416
 
Calculate the minimum length that is needed to draw the scale
417
 
.PP
418
 
\fBParameters:\fP
419
 
.RS 4
420
 
\fIpen\fP Pen that is used for painting backbone and ticks 
421
 
.br
422
 
\fIfont\fP Font used for painting the labels
423
 
.RE
424
 
.PP
425
 
\fBSee also:\fP
426
 
.RS 4
427
 
\fBextent()\fP 
428
 
.RE
429
 
.PP
430
 
 
431
 
.SS "void QwtScaleDraw::move (const QPoint & pos)"
432
 
.PP
433
 
Move the position of the scale. 
434
 
.PP
435
 
The meaning of the parameter pos depends on the alignment: 
436
 
.IP "\fBQwtScaleDraw::LeftScale \fP" 1c
437
 
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. 
438
 
.IP "\fBQwtScaleDraw::RightScale \fP" 1c
439
 
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. 
440
 
.IP "\fBQwtScaleDraw::TopScale \fP" 1c
441
 
The origin is the leftmost point of the backbone. The backbone is a horizontal line. Scale marks and labels are drawn above the backbone. 
442
 
.IP "\fBQwtScaleDraw::BottomScale \fP" 1c
443
 
The origin is the leftmost point of the backbone. The backbone is a horizontal line Scale marks and labels are drawn below the backbone. 
444
 
.PP
445
 
.PP
446
 
\fBParameters:\fP
447
 
.RS 4
448
 
\fIpos\fP Origin of the scale
449
 
.RE
450
 
.PP
451
 
\fBSee also:\fP
452
 
.RS 4
453
 
\fBpos()\fP, \fBsetLength()\fP 
454
 
.RE
455
 
.PP
456
 
 
457
 
.SS "void QwtScaleDraw::move (int x, int y)\fC [inline]\fP"
458
 
.PP
459
 
Move the position of the scale 
460
 
.PP
461
 
\fBSee also:\fP
462
 
.RS 4
463
 
\fBmove(const QPoint &)\fP 
464
 
.RE
465
 
.PP
466
 
 
467
 
.SS "\fBQwtScaleDraw\fP & QwtScaleDraw::operator= (const \fBQwtScaleDraw\fP & other)"
468
 
.PP
469
 
Assignment operator. 
470
 
.PP
471
 
.SS "Qt::Orientation QwtScaleDraw::orientation () const"
472
 
.PP
473
 
Return the orientation
474
 
.PP
475
 
TopScale, BottomScale are horizontal (Qt::Horizontal) scales, LeftScale, RightScale are vertical (Qt::Vertical) scales.
476
 
.PP
477
 
\fBSee also:\fP
478
 
.RS 4
479
 
\fBalignment()\fP 
480
 
.RE
481
 
.PP
482
 
 
483
 
.SS "QPoint QwtScaleDraw::pos () const"
484
 
.PP
485
 
\fBReturns:\fP
486
 
.RS 4
487
 
Origin of the scale 
488
 
.RE
489
 
.PP
490
 
\fBSee also:\fP
491
 
.RS 4
492
 
\fBmove()\fP, \fBlength()\fP 
493
 
.RE
494
 
.PP
495
 
 
496
 
.SS "void QwtScaleDraw::setAlignment (\fBAlignment\fP align)"
497
 
.PP
498
 
Set the alignment of the scale
499
 
.PP
500
 
The default alignment is QwtScaleDraw::BottomScale 
501
 
.PP
502
 
\fBSee also:\fP
503
 
.RS 4
504
 
\fBalignment()\fP 
505
 
.RE
506
 
.PP
507
 
 
508
 
.SS "void QwtScaleDraw::setLabelAlignment (Qt::Alignment alignment)"
509
 
.PP
510
 
Change the label flags. 
511
 
.PP
512
 
Labels are aligned to the point ticklength + spacing away from the backbone.
513
 
.PP
514
 
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:
515
 
.PP
516
 
QwtScaleDraw::TopScale: Qt::AlignHCenter | Qt::AlignTop
517
 
.br
518
 
 QwtScaleDraw::BottomScale: Qt::AlignHCenter | Qt::AlignBottom
519
 
.br
520
 
 QwtScaleDraw::LeftScale: Qt::AlignLeft | Qt::AlignVCenter
521
 
.br
522
 
 QwtScaleDraw::RightScale: Qt::AlignRight | Qt::AlignVCenter
523
 
.br
524
 
.PP
525
 
Changing the alignment is often necessary for rotated labels.
526
 
.PP
527
 
\fBParameters:\fP
528
 
.RS 4
529
 
\fIalignment\fP Or'd Qt::AlignmentFlags <see qnamespace.h>
530
 
.RE
531
 
.PP
532
 
\fBSee also:\fP
533
 
.RS 4
534
 
\fBsetLabelRotation()\fP, \fBlabelRotation()\fP, \fBlabelAlignment()\fP 
535
 
.RE
536
 
.PP
537
 
\fBWarning:\fP
538
 
.RS 4
539
 
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 \fBQwtAbstractScaleDraw::label()\fP. 
540
 
.RE
541
 
.PP
542
 
 
543
 
.SS "void QwtScaleDraw::setLabelRotation (double rotation)"
544
 
.PP
545
 
Rotate all labels.
546
 
.PP
547
 
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.
548
 
.PP
549
 
\fBParameters:\fP
550
 
.RS 4
551
 
\fIrotation\fP Angle in degrees. When changing the label rotation, the label flags often needs to be adjusted too.
552
 
.RE
553
 
.PP
554
 
\fBSee also:\fP
555
 
.RS 4
556
 
\fBsetLabelAlignment()\fP, \fBlabelRotation()\fP, \fBlabelAlignment()\fP. 
557
 
.RE
558
 
.PP
559
 
 
560
 
.SS "void QwtScaleDraw::setLength (int length)"
561
 
.PP
562
 
Set the length of the backbone.
563
 
.PP
564
 
The length doesn't include the space needed for overlapping labels.
565
 
.PP
566
 
\fBSee also:\fP
567
 
.RS 4
568
 
\fBmove()\fP, \fBminLabelDist()\fP 
569
 
.RE
570
 
.PP
571
 
 
572
 
 
573
 
.SH "Author"
574
 
.PP 
575
 
Generated automatically by Doxygen for Qwt User's Guide from the source code.