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