1
.TH "QwtScaleWidget" 3 "1 May 2008" "Version 5.1.0" "Qwt User's Guide" \" -*- nroff -*-
9
.SH "Detailed Description"
11
A Widget which contains a scale.
13
This Widget can be used to decorate composite widgets with a scale.
15
Definition at line 34 of file qwt_scale_widget.h.
20
.RI "void \fBscaleDivChanged\fP ()"
23
.SS "Public Member Functions"
27
.RI "\fBQwtScaleWidget\fP (QWidget *parent=NULL)"
30
.RI "\fBQwtScaleWidget\fP (\fBQwtScaleDraw::Alignment\fP, QWidget *parent=NULL)"
33
.RI "virtual \fB~QwtScaleWidget\fP ()"
36
.RI "void \fBsetTitle\fP (const QString &title)"
39
.RI "void \fBsetTitle\fP (const \fBQwtText\fP &title)"
42
.RI "\fBQwtText\fP \fBtitle\fP () const"
45
.RI "void \fBsetBorderDist\fP (int start, int end)"
48
.RI "int \fBstartBorderDist\fP () const"
51
.RI "int \fBendBorderDist\fP () const"
54
.RI "void \fBgetBorderDistHint\fP (int &start, int &end) const "
57
.RI "void \fBgetMinBorderDist\fP (int &start, int &end) const "
60
.RI "void \fBsetMinBorderDist\fP (int start, int end)"
63
.RI "void \fBsetMargin\fP (int)"
66
.RI "int \fBmargin\fP () const"
69
.RI "void \fBsetSpacing\fP (int td)"
72
.RI "int \fBspacing\fP () const"
75
.RI "void \fBsetPenWidth\fP (int)"
78
.RI "int \fBpenWidth\fP () const"
81
.RI "void \fBsetScaleDiv\fP (\fBQwtScaleTransformation\fP *, const \fBQwtScaleDiv\fP &sd)"
84
.RI "void \fBsetScaleDraw\fP (\fBQwtScaleDraw\fP *)"
87
.RI "const \fBQwtScaleDraw\fP * \fBscaleDraw\fP () const"
90
.RI "\fBQwtScaleDraw\fP * \fBscaleDraw\fP ()"
93
.RI "void \fBsetLabelAlignment\fP (Qt::Alignment)"
96
.RI "void \fBsetLabelRotation\fP (double rotation)"
99
.RI "void \fBsetColorBarEnabled\fP (bool)"
102
.RI "bool \fBisColorBarEnabled\fP () const"
105
.RI "void \fBsetColorBarWidth\fP (int)"
108
.RI "int \fBcolorBarWidth\fP () const"
111
.RI "void \fBsetColorMap\fP (const \fBQwtDoubleInterval\fP &, const \fBQwtColorMap\fP &)"
114
.RI "\fBQwtDoubleInterval\fP \fBcolorBarInterval\fP () const"
117
.RI "const \fBQwtColorMap\fP & \fBcolorMap\fP () const"
120
.RI "virtual QSize \fBsizeHint\fP () const"
123
.RI "virtual QSize \fBminimumSizeHint\fP () const"
126
.RI "int \fBtitleHeightForWidth\fP (int width) const"
129
.RI "int \fBdimForLength\fP (int length, const QFont &scaleFont) const"
132
.RI "void \fBdrawColorBar\fP (QPainter *painter, const QRect &rect) const"
135
.RI "void \fBdrawTitle\fP (QPainter *painter, \fBQwtScaleDraw::Alignment\fP, const QRect &rect) const"
138
.RI "void \fBsetAlignment\fP (\fBQwtScaleDraw::Alignment\fP)"
141
.RI "\fBQwtScaleDraw::Alignment\fP \fBalignment\fP () const"
144
.RI "QRect \fBcolorBarRect\fP (const QRect &) const "
147
.SS "Protected Member Functions"
151
.RI "virtual void \fBpaintEvent\fP (QPaintEvent *e)"
154
.RI "virtual void \fBresizeEvent\fP (QResizeEvent *e)"
157
.RI "void \fBdraw\fP (QPainter *p) const "
160
.RI "void \fBscaleChange\fP ()"
163
.RI "void \fBlayoutScale\fP (bool update=true)"
166
.SH "Constructor & Destructor Documentation"
168
.SS "QwtScaleWidget::QwtScaleWidget (QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
170
Create a scale with the position QwtScaleWidget::Left.
174
\fIparent\fP Parent widget
179
Definition at line 63 of file qwt_scale_widget.cpp.
180
.SS "QwtScaleWidget::QwtScaleWidget (\fBQwtScaleDraw::Alignment\fP align, QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
186
\fIalign\fP Alignment.
188
\fIparent\fP Parent widget
193
Definition at line 87 of file qwt_scale_widget.cpp.
194
.SS "QwtScaleWidget::~QwtScaleWidget ()\fC [virtual]\fP"
198
Definition at line 95 of file qwt_scale_widget.cpp.
199
.SH "Member Function Documentation"
201
.SS "void QwtScaleWidget::scaleDivChanged ()\fC [signal]\fP"
203
Signal emitted, whenever the scale divison changes.
205
Referenced by setScaleDiv().
206
.SS "void QwtScaleWidget::setTitle (const \fBQwtText\fP & title)"
208
Give title new text contents.
212
\fItitle\fP New title
217
\fBQwtScaleWidget::title\fP
222
The title flags are interpreted in direction of the label, AlignTop, AlignBottom can't be set as the title will always be aligned to the scale.
227
Definition at line 167 of file qwt_scale_widget.cpp.
229
References layoutScale(), QwtText::renderFlags(), QwtText::setRenderFlags(), and title().
230
.SS "\fBQwtText\fP QwtScaleWidget::title () const"
239
\fBQwtScaleWidget::setTitle\fP
244
Definition at line 357 of file qwt_scale_widget.cpp.
246
Referenced by QwtPlotPrintFilter::apply(), QwtPlot::axisTitle(), drawTitle(), and setTitle().
247
.SS "void QwtScaleWidget::setBorderDist (int dist1, int dist2)"
249
Specify distances of the scale's endpoints from the widget's borders. The actual borders will never be less than minimum border distance.
253
\fIdist1\fP Left or top Distance
255
\fIdist2\fP Right or bottom distance
260
QwtScaleWidget::borderDist
265
Definition at line 233 of file qwt_scale_widget.cpp.
267
References layoutScale().
269
Referenced by QwtPlot::updateAxes().
270
.SS "int QwtScaleWidget::startBorderDist () const"
274
start border distance
279
\fBQwtScaleWidget::setBorderDist\fP
284
Definition at line 366 of file qwt_scale_widget.cpp.
286
Referenced by QwtPlot::canvasMap(), and QwtPlot::print().
287
.SS "int QwtScaleWidget::endBorderDist () const"
296
\fBQwtScaleWidget::setBorderDist\fP
301
Definition at line 375 of file qwt_scale_widget.cpp.
303
Referenced by QwtPlot::canvasMap(), and QwtPlot::print().
304
.SS "void QwtScaleWidget::getBorderDistHint (int & start, int & end) const"
306
Calculate a hint for the border distances.
308
This member function calculates the distance of the scale's endpoints from the widget borders which is required for the mark labels to fit into the widget. The maximum of this distance an the minimum border distance is returned.
314
The minimum border distance depends on the font.
320
\fBsetMinBorderDist()\fP, \fBgetMinBorderDist()\fP, \fBsetBorderDist()\fP
325
Definition at line 774 of file qwt_scale_widget.cpp.
327
Referenced by layoutScale(), minimumSizeHint(), and QwtPlot::updateAxes().
328
.SS "void QwtScaleWidget::getMinBorderDist (int & start, int & end) const"
330
Get the minimum value for the distances of the scale's endpoints from the widget borders.
334
\fBsetMinBorderDist()\fP, \fBgetBorderDistHint()\fP
339
Definition at line 805 of file qwt_scale_widget.cpp.
340
.SS "void QwtScaleWidget::setMinBorderDist (int start, int end)"
342
Set a minimum value for the distances of the scale's endpoints from the widget borders. This is useful to avoid that the scales are 'jumping', when the tick labels or their positions change often.
346
\fBgetMinBorderDist()\fP, \fBgetBorderDistHint()\fP
351
Definition at line 793 of file qwt_scale_widget.cpp.
352
.SS "void QwtScaleWidget::setMargin (int margin)"
354
Specify the margin to the colorBar/base line.
363
\fBQwtScaleWidget::margin\fP
368
Definition at line 248 of file qwt_scale_widget.cpp.
370
References layoutScale().
372
Referenced by QwtPlot::print().
373
.SS "int QwtScaleWidget::margin () const"
382
\fBQwtScaleWidget::setMargin\fP
387
Definition at line 384 of file qwt_scale_widget.cpp.
389
Referenced by QwtPlot::print().
390
.SS "void QwtScaleWidget::setSpacing (int spacing)"
392
Specify the distance between color bar, scale and title.
396
\fIspacing\fP Spacing
401
\fBQwtScaleWidget::spacing\fP
406
Definition at line 263 of file qwt_scale_widget.cpp.
408
References layoutScale().
409
.SS "int QwtScaleWidget::spacing () const"
413
distance between scale and title
418
\fBQwtScaleWidget::setMargin\fP
423
Definition at line 393 of file qwt_scale_widget.cpp.
425
Referenced by QwtPlot::printScale().
426
.SS "void QwtScaleWidget::setPenWidth (int width)"
428
Specify the width of the scale pen.
432
\fIwidth\fP Pen width
437
\fBQwtScaleWidget::penWidth\fP
442
Definition at line 278 of file qwt_scale_widget.cpp.
444
References layoutScale().
445
.SS "int QwtScaleWidget::penWidth () const"
454
\fBQwtScaleWidget::setPenWidth\fP
459
Definition at line 402 of file qwt_scale_widget.cpp.
461
Referenced by QwtPlot::printScale().
462
.SS "void QwtScaleWidget::setScaleDiv (\fBQwtScaleTransformation\fP * transformation, const \fBQwtScaleDiv\fP & scaleDiv)"
464
Assign a scale division.
466
The scale division determines where to set the tick marks.
470
\fItransformation\fP Transformation, needed to translate between scale and pixal values
472
\fIscaleDiv\fP Scale Division
477
For more information about scale divisions, see \fBQwtScaleDiv\fP.
482
Definition at line 839 of file qwt_scale_widget.cpp.
484
References layoutScale(), QwtAbstractScaleDraw::map(), QwtAbstractScaleDraw::scaleDiv(), scaleDivChanged(), QwtAbstractScaleDraw::setScaleDiv(), QwtAbstractScaleDraw::setTransformation(), QwtScaleMap::transformation(), and QwtScaleTransformation::type().
486
Referenced by QwtPlot::updateAxes().
487
.SS "void QwtScaleWidget::setScaleDraw (\fBQwtScaleDraw\fP *)"
489
Set a scale draw sd has to be created with new and will be deleted in QwtScaleWidget::~QwtScale or the next call of \fBQwtScaleWidget::setScaleDraw\fP.
491
Definition at line 321 of file qwt_scale_widget.cpp.
493
References layoutScale(), and QwtScaleDraw::setAlignment().
495
Referenced by QwtPlot::setAxisScaleDraw().
496
.SS "const \fBQwtScaleDraw\fP * QwtScaleWidget::scaleDraw () const"
498
scaleDraw of this scale
502
QwtScaleDraw::setScaleDraw
507
Definition at line 339 of file qwt_scale_widget.cpp.
509
Referenced by alignment(), QwtPlot::axisScaleDraw(), QwtPlot::printScale(), and QwtPlot::sizeHint().
510
.SS "\fBQwtScaleDraw\fP * QwtScaleWidget::scaleDraw ()"
512
scaleDraw of this scale
516
QwtScaleDraw::setScaleDraw
521
Definition at line 348 of file qwt_scale_widget.cpp.
522
.SS "void QwtScaleWidget::setLabelAlignment (Qt::Alignment alignment)"
524
Change the alignment for the labels.
528
\fBQwtScaleDraw::setLabelAlignment()\fP, \fBQwtScaleWidget::setLabelRotation()\fP
533
Definition at line 298 of file qwt_scale_widget.cpp.
534
.SS "void QwtScaleWidget::setLabelRotation (double rotation)"
536
Change the rotation for the labels. See \fBQwtScaleDraw::setLabelRotation()\fP.
540
\fBQwtScaleDraw::setLabelRotation()\fP, QwtScaleWidget::setLabelFlags()
545
Definition at line 310 of file qwt_scale_widget.cpp.
547
References layoutScale().
549
Referenced by QwtPlot::setAxisLabelRotation().
550
.SS "QSize QwtScaleWidget::sizeHint () const\fC [virtual]\fP"
559
Definition at line 689 of file qwt_scale_widget.cpp.
561
References minimumSizeHint().
562
.SS "QSize QwtScaleWidget::minimumSizeHint () const\fC [virtual]\fP"
571
Definition at line 697 of file qwt_scale_widget.cpp.
573
References dimForLength(), and getBorderDistHint().
575
Referenced by QwtPlotLayout::minimumSizeHint(), sizeHint(), and QwtPlot::sizeHint().
576
.SS "int QwtScaleWidget::titleHeightForWidth (int width) const"
578
Find the height of the title for a given width.
592
Definition at line 732 of file qwt_scale_widget.cpp.
594
Referenced by dimForLength().
595
.SS "int QwtScaleWidget::dimForLength (int length, const QFont & scaleFont) const"
597
Find the minimum dimension for a given length. dim is the height, length the width seen in direction of the title.
601
\fIlength\fP width for horizontal, height for vertical scales
603
\fIscaleFont\fP Font of the scale
608
height for horizontal, width for vertical scales
613
Definition at line 746 of file qwt_scale_widget.cpp.
615
References titleHeightForWidth().
617
Referenced by minimumSizeHint().
618
.SS "void QwtScaleWidget::drawTitle (QPainter * painter, \fBQwtScaleDraw::Alignment\fP align, const QRect & rect) const"
620
Rotate and paint a title according to its position into a given rectangle.
624
\fIpainter\fP Painter
626
\fIalign\fP Alignment
628
\fIrect\fP Bounding rectangle
633
Definition at line 621 of file qwt_scale_widget.cpp.
635
References QwtText::draw(), QwtText::setRenderFlags(), and title().
637
Referenced by draw(), and QwtPlot::printScale().
638
.SS "void QwtScaleWidget::setAlignment (\fBQwtScaleDraw::Alignment\fP alignment)"
644
\fIalignment\fP New alignment
649
\fBQwtScaleWidget::alignment\fP
654
Definition at line 186 of file qwt_scale_widget.cpp.
656
References layoutScale().
657
.SS "\fBQwtScaleDraw::Alignment\fP QwtScaleWidget::alignment () const"
666
QwtScaleWidget::setPosition
671
Definition at line 217 of file qwt_scale_widget.cpp.
673
References QwtScaleDraw::alignment(), and scaleDraw().
674
.SS "void QwtScaleWidget::paintEvent (QPaintEvent * e)\fC [protected, virtual]\fP"
678
Definition at line 409 of file qwt_scale_widget.cpp.
681
.SS "void QwtScaleWidget::resizeEvent (QResizeEvent * e)\fC [protected, virtual]\fP"
685
Definition at line 541 of file qwt_scale_widget.cpp.
687
References layoutScale().
688
.SS "void QwtScaleWidget::draw (QPainter * p) const\fC [protected]\fP"
692
Definition at line 427 of file qwt_scale_widget.cpp.
694
References colorBarRect(), drawColorBar(), and drawTitle().
696
Referenced by paintEvent().
697
.SS "void QwtScaleWidget::scaleChange ()\fC [protected]\fP"
699
Notify a change of the scale.
701
This virtual function can be overloaded by derived classes. The default implementation updates the geometry and repaints the widget.
703
Definition at line 681 of file qwt_scale_widget.cpp.
705
References layoutScale().
706
.SS "void QwtScaleWidget::layoutScale (bool update = \fCtrue\fP)\fC [protected]\fP"
708
Recalculate the scale's geometry and layout based on.
710
Definition at line 551 of file qwt_scale_widget.cpp.
712
References colorBarWidth(), and getBorderDistHint().
714
Referenced by resizeEvent(), scaleChange(), setAlignment(), setBorderDist(), setColorBarEnabled(), setColorBarWidth(), setColorMap(), setLabelRotation(), setMargin(), setPenWidth(), setScaleDiv(), setScaleDraw(), setSpacing(), and setTitle().
718
Generated automatically by Doxygen for Qwt User's Guide from the source code.