1
.TH "QwtPlot" 3 "24 May 2008" "Version 5.1.1" "Qwt User's Guide" \" -*- nroff -*-
9
Inherits \fBQwtPlotDict\fP.
11
.SH "Detailed Description"
13
A 2-D plotting widget.
15
\fBQwtPlot\fP is a widget for plotting two-dimensional graphs. An unlimited number of plot items can be displayed on its canvas. Plot items might be curves (\fBQwtPlotCurve\fP), markers (\fBQwtPlotMarker\fP), the grid (\fBQwtPlotGrid\fP), or anything else derived from \fBQwtPlotItem\fP. A plot can have up to four axes, with each plot item attached to an x- and a y axis. The scales at the axes can be explicitely set (\fBQwtScaleDiv\fP), or are calculated from the plot items, using algorithms (\fBQwtScaleEngine\fP) which can be configured separately for each axis.
19
The following example shows (schematically) the most simple way to use \fBQwtPlot\fP. By default, only the left and bottom axes are visible and their scales are computed automatically.
24
#include <qwt_plot_curve.h>
27
double x[100], y1[100], y2[100]; // x and y values
29
myPlot = new QwtPlot("Two Curves", parent);
32
QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
33
QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2");
35
getSomeValues(x, y1, y2);
37
// copy the data into the curves
38
curve1->setData(x, y1, 100);
39
curve2->setData(x, y2, 100);
41
curve1->attach(myPlot);
42
curve2->attach(myPlot);
44
// finally, refresh the plot
54
Definition at line 77 of file qwt_plot.h.
59
.RI "enum \fBAxis\fP { \fByLeft\fP, \fByRight\fP, \fBxBottom\fP, \fBxTop\fP, \fBaxisCnt\fP }"
62
.RI "enum \fBLegendPosition\fP { \fBLeftLegend\fP, \fBRightLegend\fP, \fBBottomLegend\fP, \fBTopLegend\fP, \fBExternalLegend\fP }"
69
.RI "virtual void \fBclear\fP ()"
72
.RI "virtual void \fBreplot\fP ()"
75
.RI "void \fBautoRefresh\fP ()"
82
.RI "void \fBlegendClicked\fP (\fBQwtPlotItem\fP *plotItem)"
85
.RI "void \fBlegendChecked\fP (\fBQwtPlotItem\fP *plotItem, bool on)"
88
.SS "Public Member Functions"
92
.RI "\fBQwtPlot\fP (QWidget *=NULL)"
95
.RI "\fBQwtPlot\fP (const \fBQwtText\fP &title, QWidget *p=NULL)"
98
.RI "virtual \fB~QwtPlot\fP ()"
101
.RI "void \fBapplyProperties\fP (const QString &)"
104
.RI "QString \fBgrabProperties\fP () const"
107
.RI "void \fBsetAutoReplot\fP (bool tf=true)"
110
.RI "bool \fBautoReplot\fP () const"
113
.RI "void \fBprint\fP (QPaintDevice &p, const \fBQwtPlotPrintFilter\fP &=\fBQwtPlotPrintFilter\fP()) const"
116
.RI "virtual void \fBprint\fP (QPainter *, const QRect &rect, const \fBQwtPlotPrintFilter\fP &=\fBQwtPlotPrintFilter\fP()) const"
119
.RI "\fBQwtPlotLayout\fP * \fBplotLayout\fP ()"
122
.RI "const \fBQwtPlotLayout\fP * \fBplotLayout\fP () const"
125
.RI "void \fBsetMargin\fP (int margin)"
128
.RI "int \fBmargin\fP () const"
131
.RI "void \fBsetTitle\fP (const QString &)"
134
.RI "void \fBsetTitle\fP (const \fBQwtText\fP &t)"
137
.RI "\fBQwtText\fP \fBtitle\fP () const"
140
.RI "\fBQwtTextLabel\fP * \fBtitleLabel\fP ()"
143
.RI "const \fBQwtTextLabel\fP * \fBtitleLabel\fP () const"
146
.RI "\fBQwtPlotCanvas\fP * \fBcanvas\fP ()"
149
.RI "const \fBQwtPlotCanvas\fP * \fBcanvas\fP () const"
152
.RI "void \fBsetCanvasBackground\fP (const QColor &c)"
155
.RI "const QColor & \fBcanvasBackground\fP () const"
158
.RI "void \fBsetCanvasLineWidth\fP (int w)"
161
.RI "int \fBcanvasLineWidth\fP () const"
164
.RI "virtual \fBQwtScaleMap\fP \fBcanvasMap\fP (int axisId) const"
167
.RI "double \fBinvTransform\fP (int axisId, int pos) const "
170
.RI "int \fBtransform\fP (int axisId, double value) const"
173
.RI "\fBQwtScaleEngine\fP * \fBaxisScaleEngine\fP (int axisId)"
176
.RI "const \fBQwtScaleEngine\fP * \fBaxisScaleEngine\fP (int axisId) const"
179
.RI "void \fBsetAxisScaleEngine\fP (int axisId, \fBQwtScaleEngine\fP *)"
182
.RI "void \fBsetAxisAutoScale\fP (int axisId)"
185
.RI "bool \fBaxisAutoScale\fP (int axisId) const"
188
.RI "void \fBenableAxis\fP (int axisId, bool tf=true)"
191
.RI "bool \fBaxisEnabled\fP (int axisId) const"
194
.RI "void \fBsetAxisFont\fP (int axisId, const QFont &f)"
197
.RI "QFont \fBaxisFont\fP (int axisId) const"
200
.RI "void \fBsetAxisScale\fP (int axisId, double min, double max, double step=0)"
203
.RI "void \fBsetAxisScaleDiv\fP (int axisId, const \fBQwtScaleDiv\fP &)"
206
.RI "void \fBsetAxisScaleDraw\fP (int axisId, \fBQwtScaleDraw\fP *)"
209
.RI "double \fBaxisStepSize\fP (int axisId) const"
212
.RI "const \fBQwtScaleDiv\fP * \fBaxisScaleDiv\fP (int axisId) const"
215
.RI "\fBQwtScaleDiv\fP * \fBaxisScaleDiv\fP (int axisId)"
218
.RI "const \fBQwtScaleDraw\fP * \fBaxisScaleDraw\fP (int axisId) const"
221
.RI "\fBQwtScaleDraw\fP * \fBaxisScaleDraw\fP (int axisId)"
224
.RI "const \fBQwtScaleWidget\fP * \fBaxisWidget\fP (int axisId) const"
227
.RI "\fBQwtScaleWidget\fP * \fBaxisWidget\fP (int axisId)"
230
.RI "void \fBsetAxisLabelAlignment\fP (int axisId, Qt::Alignment)"
233
.RI "void \fBsetAxisLabelRotation\fP (int axisId, double rotation)"
236
.RI "void \fBsetAxisTitle\fP (int axisId, const QString &)"
239
.RI "void \fBsetAxisTitle\fP (int axisId, const \fBQwtText\fP &)"
242
.RI "\fBQwtText\fP \fBaxisTitle\fP (int axisId) const"
245
.RI "void \fBsetAxisMaxMinor\fP (int axisId, int maxMinor)"
248
.RI "int \fBaxisMaxMajor\fP (int axisId) const"
251
.RI "void \fBsetAxisMaxMajor\fP (int axisId, int maxMajor)"
254
.RI "int \fBaxisMaxMinor\fP (int axisId) const"
257
.RI "void \fBinsertLegend\fP (\fBQwtLegend\fP *, \fBLegendPosition\fP=QwtPlot::RightLegend, double ratio=-1.0)"
260
.RI "\fBQwtLegend\fP * \fBlegend\fP ()"
263
.RI "const \fBQwtLegend\fP * \fBlegend\fP () const"
266
.RI "virtual void \fBpolish\fP ()"
269
.RI "virtual QSize \fBsizeHint\fP () const"
272
.RI "virtual QSize \fBminimumSizeHint\fP () const"
275
.RI "virtual void \fBupdateLayout\fP ()"
278
.RI "virtual bool \fBevent\fP (QEvent *)"
281
.SS "Protected Slots"
285
.RI "virtual void \fBlegendItemClicked\fP ()"
288
.RI "virtual void \fBlegendItemChecked\fP (bool)"
291
.SS "Protected Member Functions"
295
.RI "virtual void \fBdrawCanvas\fP (QPainter *)"
298
.RI "virtual void \fBdrawItems\fP (QPainter *, const QRect &, const \fBQwtScaleMap\fP maps[axisCnt], const \fBQwtPlotPrintFilter\fP &) const"
301
.RI "virtual void \fBupdateTabOrder\fP ()"
304
.RI "void \fBupdateAxes\fP ()"
307
.RI "virtual void \fBresizeEvent\fP (QResizeEvent *e)"
310
.RI "virtual void \fBprintLegendItem\fP (QPainter *, const QWidget *, const QRect &) const"
313
.RI "virtual void \fBprintTitle\fP (QPainter *, const QRect &) const"
316
.RI "virtual void \fBprintScale\fP (QPainter *, int axisId, int startDist, int endDist, int baseDist, const QRect &) const"
319
.RI "virtual void \fBprintCanvas\fP (QPainter *, const QRect &boundingRect, const QRect &canvasRect, const \fBQwtScaleMap\fP maps[axisCnt], const \fBQwtPlotPrintFilter\fP &) const"
322
.RI "virtual void \fBprintLegend\fP (QPainter *, const QRect &) const"
325
.SS "Static Protected Member Functions"
329
.RI "static bool \fBaxisValid\fP (int axisId)"
336
.RI "class \fBQwtPlotCanvas\fP"
339
.SH "Member Enumeration Documentation"
341
.SS "enum \fBQwtPlot::Axis\fP"
345
Definition at line 87 of file qwt_plot.h.
346
.SS "enum \fBQwtPlot::LegendPosition\fP"
348
Position of the legend, relative to the canvas.
350
ExternalLegend means that only the content of the legend will be handled by \fBQwtPlot\fP, but not its geometry. This might be interesting if an application wants to have a legend in an external window.
352
Definition at line 105 of file qwt_plot.h.
353
.SH "Constructor & Destructor Documentation"
355
.SS "QwtPlot::QwtPlot (QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
361
\fIparent\fP Parent widget
366
Definition at line 52 of file qwt_plot.cpp.
367
.SS "QwtPlot::QwtPlot (const \fBQwtText\fP & title, QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
373
\fItitle\fP Title text
375
\fIparent\fP Parent widget
380
Definition at line 63 of file qwt_plot.cpp.
383
.SS "QwtPlot::~QwtPlot ()\fC [virtual]\fP"
387
Definition at line 84 of file qwt_plot.cpp.
389
References QwtPlotDict::autoDelete(), and QwtPlotDict::detachItems().
390
.SH "Member Function Documentation"
392
.SS "void QwtPlot::setAutoReplot (bool tf = \fCtrue\fP)"
394
Set or reset the autoReplot option.
396
If the autoReplot option is set, the plot will be updated implicitly by manipulating member functions. Since this may be time-consuming, it is recommended to leave this option switched off and call \fBreplot()\fP explicitly if necessary.
398
The autoReplot option is set to false by default, which means that the user has to call \fBreplot()\fP in order to make changes visible.
402
\fItf\fP \fCtrue\fP or \fCfalse\fP. Defaults to \fCtrue\fP.
412
Definition at line 184 of file qwt_plot.cpp.
414
Referenced by QwtPlotPrintFilter::apply(), QwtPlotCanvas::drawContents(), QwtPlotPanner::moveCanvas(), replot(), QwtPlotZoomer::rescale(), QwtPlotMagnifier::rescale(), and QwtPlotPrintFilter::reset().
415
.SS "bool QwtPlot::autoReplot () const"
419
true if the autoReplot option is set.
424
Definition at line 190 of file qwt_plot.cpp.
426
Referenced by QwtPlotPrintFilter::apply(), QwtPlotCanvas::drawContents(), QwtPlotPanner::moveCanvas(), replot(), QwtPlotZoomer::rescale(), QwtPlotMagnifier::rescale(), and QwtPlotPrintFilter::reset().
427
.SS "void QwtPlot::print (QPaintDevice & paintDev, const \fBQwtPlotPrintFilter\fP & pfilter = \fC\fBQwtPlotPrintFilter\fP()\fP) const"
429
Print the plot to a \fCQPaintDevice\fP (\fCQPrinter\fP) This function prints the contents of a \fBQwtPlot\fP instance to \fCQPaintDevice\fP object. The size is derived from its device metrics.
433
\fIpaintDev\fP device to paint on, often a printer
435
\fIpfilter\fP print filter
442
\fBQwtPlotPrintFilter\fP
447
Definition at line 43 of file qwt_plot_print.cpp.
448
.SS "void QwtPlot::print (QPainter * painter, const QRect & plotRect, const \fBQwtPlotPrintFilter\fP & pfilter = \fC\fBQwtPlotPrintFilter\fP()\fP) const\fC [virtual]\fP"
450
Paint the plot into a given rectangle. Paint the contents of a \fBQwtPlot\fP instance into a given rectangle.
454
\fIpainter\fP Painter
456
\fIplotRect\fP Bounding rectangle
458
\fIpfilter\fP Print filter
463
\fBQwtPlotPrintFilter\fP
468
Definition at line 73 of file qwt_plot_print.cpp.
470
References QwtPlotPrintFilter::apply(), axisEnabled(), axisScaleDiv(), axisScaleEngine(), axisWidget(), QwtPlotLayout::canvasMargin(), QwtPlotLayout::canvasRect(), QwtScaleWidget::endBorderDist(), QwtScaleDiv::hBound(), QwtLegend::isEmpty(), QwtScaleDiv::lBound(), legend(), margin(), QwtScaleWidget::margin(), QwtPainter::metricsMap(), QwtPlotPrintFilter::options(), plotLayout(), printCanvas(), printLegend(), printScale(), printTitle(), QwtPlotPrintFilter::reset(), QwtPainter::resetMetricsMap(), QwtPlotLayout::scaleRect(), QwtScaleWidget::setMargin(), QwtPainter::setMetricsMap(), QwtScaleMap::setPaintXInterval(), QwtScaleMap::setScaleInterval(), QwtScaleWidget::startBorderDist(), and titleLabel().
471
.SS "\fBQwtPlotLayout\fP * QwtPlot::plotLayout ()"
480
Definition at line 228 of file qwt_plot.cpp.
482
Referenced by canvasMap(), and print().
483
.SS "const \fBQwtPlotLayout\fP * QwtPlot::plotLayout () const"
487
the plot's titel label.
492
Definition at line 234 of file qwt_plot.cpp.
493
.SS "void QwtPlot::setMargin (int margin)"
495
Change the margin of the plot. The margin is the space around all components.
499
\fImargin\fP new margin
504
\fBQwtPlotLayout::setMargin()\fP, \fBmargin()\fP, \fBplotLayout()\fP
509
Definition at line 665 of file qwt_plot.cpp.
511
References updateLayout().
512
.SS "int QwtPlot::margin () const"
521
\fBsetMargin()\fP, \fBQwtPlotLayout::margin()\fP, \fBplotLayout()\fP
526
Definition at line 681 of file qwt_plot.cpp.
528
Referenced by canvasMap(), and print().
529
.SS "void QwtPlot::setTitle (const QString & title)"
531
Change the plot's title
535
\fItitle\fP New title
540
Definition at line 199 of file qwt_plot.cpp.
542
References updateLayout().
544
Referenced by applyProperties().
545
.SS "void QwtPlot::setTitle (const \fBQwtText\fP & title)"
547
Change the plot's title
551
\fItitle\fP New title
556
Definition at line 212 of file qwt_plot.cpp.
558
References title(), and updateLayout().
559
.SS "\fBQwtText\fP QwtPlot::title () const"
568
Definition at line 222 of file qwt_plot.cpp.
570
Referenced by grabProperties(), QwtPlot(), setAxisTitle(), and setTitle().
571
.SS "\fBQwtTextLabel\fP * QwtPlot::titleLabel ()"
575
the plot's titel label.
580
Definition at line 240 of file qwt_plot.cpp.
582
Referenced by QwtPlotPrintFilter::apply(), print(), printTitle(), and QwtPlotPrintFilter::reset().
583
.SS "const \fBQwtTextLabel\fP * QwtPlot::titleLabel () const"
587
the plot's titel label.
592
Definition at line 248 of file qwt_plot.cpp.
593
.SS "\fBQwtPlotCanvas\fP * QwtPlot::canvas ()"
602
Definition at line 275 of file qwt_plot.cpp.
604
Referenced by canvasBackground(), canvasLineWidth(), QwtPlotCurve::draw(), QwtPlotLayout::minimumSizeHint(), printCanvas(), replot(), setCanvasBackground(), and setCanvasLineWidth().
605
.SS "const \fBQwtPlotCanvas\fP * QwtPlot::canvas () const"
614
Definition at line 283 of file qwt_plot.cpp.
615
.SS "void QwtPlot::setCanvasBackground (const QColor & c)"
617
Change the background of the plotting area.
619
Sets c to QColorGroup::Background of all colorgroups of the palette of the canvas. Using \fBcanvas()\fP->setPalette() is a more powerful way to set these colors.
623
\fIc\fP new background color
628
Definition at line 694 of file qwt_plot.cpp.
632
Referenced by QwtPlotPrintFilter::apply(), and QwtPlotPrintFilter::reset().
633
.SS "const QColor & QwtPlot::canvasBackground () const"
635
Nothing else than: \fBcanvas()\fP->palette().color( QPalette::Normal, QColorGroup::Background);
639
the background color of the plotting area.
644
Definition at line 716 of file qwt_plot.cpp.
648
Referenced by QwtPlotPrintFilter::apply().
649
.SS "void QwtPlot::setCanvasLineWidth (int w)"
651
Change the border width of the plotting area Nothing else than \fBcanvas()\fP->setLineWidth(w), left for compatibility only.
655
\fIw\fP new border width
660
Definition at line 733 of file qwt_plot.cpp.
662
References canvas(), and updateLayout().
663
.SS "int QwtPlot::canvasLineWidth () const"
665
Nothing else than: \fBcanvas()\fP->lineWidth(), left for compatibility only.
669
the border width of the plotting area
674
Definition at line 744 of file qwt_plot.cpp.
677
.SS "\fBQwtScaleMap\fP QwtPlot::canvasMap (int axisId) const\fC [virtual]\fP"
686
Map for the axis on the canvas. With this map pixel coordinates can translated to plot coordinates and vice versa.
691
\fBQwtScaleMap\fP, \fBtransform()\fP, \fBinvTransform()\fP
696
Definition at line 612 of file qwt_plot.cpp.
698
References axisEnabled(), axisScaleDiv(), axisScaleEngine(), axisWidget(), QwtPlotLayout::canvasMargin(), QwtScaleWidget::endBorderDist(), QwtScaleDiv::hBound(), QwtScaleDiv::lBound(), margin(), plotLayout(), QwtScaleMap::setPaintInterval(), QwtScaleMap::setScaleInterval(), QwtScaleMap::setTransformation(), and QwtScaleWidget::startBorderDist().
700
Referenced by QwtPlotCurve::closestPoint(), QwtPlotCurve::draw(), drawCanvas(), QwtPlotPicker::invTransform(), invTransform(), QwtPlotPanner::moveCanvas(), QwtPlotPicker::transform(), and transform().
701
.SS "double QwtPlot::invTransform (int axisId, int pos) const"
703
Transform the x or y coordinate of a position in the drawing region into a value.
707
\fIaxisId\fP axis index
714
The position can be an x or a y coordinate, depending on the specified axis.
719
Definition at line 349 of file qwt_plot_axis.cpp.
721
References axisValid(), and canvasMap().
722
.SS "int QwtPlot::transform (int axisId, double value) const"
724
Transform a value into a coordinate in the plotting region.
728
\fIaxisId\fP axis index
735
X or y coordinate in the plotting region corresponding to the value.
740
Definition at line 365 of file qwt_plot_axis.cpp.
742
References axisValid(), and canvasMap().
743
.SS "\fBQwtScaleEngine\fP * QwtPlot::axisScaleEngine (int axisId)"
747
Scale engine for a specific axis
752
Definition at line 144 of file qwt_plot_axis.cpp.
754
References axisValid().
756
Referenced by canvasMap(), and print().
757
.SS "const \fBQwtScaleEngine\fP * QwtPlot::axisScaleEngine (int axisId) const"
761
Scale engine for a specific axis
766
Definition at line 153 of file qwt_plot_axis.cpp.
768
References axisValid().
769
.SS "void QwtPlot::setAxisScaleEngine (int axisId, \fBQwtScaleEngine\fP * scaleEngine)"
771
Change the scale engine for an axis
775
\fIaxisId\fP axis index
777
\fIscaleEngine\fP Scale engine
782
\fBaxisScaleEngine()\fP
787
Definition at line 128 of file qwt_plot_axis.cpp.
789
References autoRefresh(), and axisValid().
790
.SS "void QwtPlot::setAxisAutoScale (int axisId)"
792
Enable autoscaling for a specified axis.
794
This member function is used to switch back to autoscaling mode after a fixed scale has been set. Autoscaling is enabled by default.
798
\fIaxisId\fP axis index
803
\fBQwtPlot::setAxisScale()\fP, \fBQwtPlot::setAxisScaleDiv()\fP
808
Definition at line 396 of file qwt_plot_axis.cpp.
810
References autoRefresh(), and axisValid().
811
.SS "bool QwtPlot::axisAutoScale (int axisId) const"
815
\fCtrue\fP if autoscaling is enabled
820
\fIaxisId\fP axis index
825
Definition at line 164 of file qwt_plot_axis.cpp.
827
References axisValid().
829
Referenced by updateAxes().
830
.SS "void QwtPlot::enableAxis (int axisId, bool tf = \fCtrue\fP)"
832
Enable or disable a specified axis.
834
When an axis is disabled, this only means that it is not visible on the screen. Curves, markers and can be attached to disabled axes, and transformation of screen coordinates into values works as normal.
836
Only xBottom and yLeft are enabled by default.
840
\fIaxisId\fP axis index
842
\fItf\fP \fCtrue\fP (enabled) or \fCfalse\fP (disabled)
847
Definition at line 332 of file qwt_plot_axis.cpp.
849
References axisValid(), and updateLayout().
850
.SS "bool QwtPlot::axisEnabled (int axisId) const"
854
\fCtrue\fP if a specified axis is enabled
859
\fIaxisId\fP axis index
864
Definition at line 177 of file qwt_plot_axis.cpp.
866
References axisValid().
868
Referenced by canvasMap(), QwtPlotLayout::minimumSizeHint(), print(), printScale(), QwtPlotPicker::QwtPlotPicker(), sizeHint(), and updateLayout().
869
.SS "void QwtPlot::setAxisFont (int axisId, const QFont & f)"
871
Change the font of an axis.
875
\fIaxisId\fP axis index
882
This function changes the font of the tick labels, not of the axis title.
887
Definition at line 381 of file qwt_plot_axis.cpp.
889
References axisValid(), and axisWidget().
890
.SS "QFont QwtPlot::axisFont (int axisId) const"
894
the font of the scale labels for a specified axis
899
\fIaxisId\fP axis index
904
Definition at line 189 of file qwt_plot_axis.cpp.
906
References axisValid(), and axisWidget().
907
.SS "void QwtPlot::setAxisScale (int axisId, double min, double max, double stepSize = \fC0\fP)"
909
Disable autoscaling and specify a fixed scale for a selected axis.
913
\fIaxisId\fP axis index
917
\fImax\fP minimum and maximum of the scale
919
\fIstepSize\fP Major step size. If \fCstep == 0\fP, the step size is calculated automatically using the maxMajor setting.
924
\fBsetAxisMaxMajor()\fP, \fBsetAxisAutoScale()\fP
929
Definition at line 414 of file qwt_plot_axis.cpp.
931
References autoRefresh(), and axisValid().
933
Referenced by QwtPlotPanner::moveCanvas(), QwtPlotZoomer::rescale(), and QwtPlotMagnifier::rescale().
934
.SS "void QwtPlot::setAxisScaleDiv (int axisId, const \fBQwtScaleDiv\fP & scaleDiv)"
936
Disable autoscaling and specify a fixed scale for a selected axis.
940
\fIaxisId\fP axis index
942
\fIscaleDiv\fP Scale division
947
\fBsetAxisScale()\fP, \fBsetAxisAutoScale()\fP
952
Definition at line 437 of file qwt_plot_axis.cpp.
954
References autoRefresh(), and axisValid().
955
.SS "void QwtPlot::setAxisScaleDraw (int axisId, \fBQwtScaleDraw\fP * scaleDraw)"
961
\fIaxisId\fP axis index
963
\fIscaleDraw\fP object responsible for drawing scales.
966
By passing scaleDraw it is possible to extend \fBQwtScaleDraw\fP functionality and let it take place in \fBQwtPlot\fP. Please note that scaleDraw has to be created with new and will be deleted by the corresponding QwtScale member ( like a child object ).
970
\fBQwtScaleDraw\fP, \fBQwtScaleWidget\fP
975
The attributes of scaleDraw will be overwritten by those of the previous \fBQwtScaleDraw\fP.
980
Definition at line 465 of file qwt_plot_axis.cpp.
982
References autoRefresh(), axisValid(), axisWidget(), and QwtScaleWidget::setScaleDraw().
983
.SS "double QwtPlot::axisStepSize (int axisId) const"
985
Return the step size parameter, that has been set in setAxisScale. This doesn't need to be the step size of the current scale.
989
\fIaxisId\fP axis index
994
step size parameter value
1004
Definition at line 300 of file qwt_plot_axis.cpp.
1006
References axisValid().
1007
.SS "const \fBQwtScaleDiv\fP * QwtPlot::axisScaleDiv (int axisId) const"
1009
Return the scale division of a specified axis.
1011
axisScaleDiv(axisId)->lBound(), axisScaleDiv(axisId)->hBound() are the current limits of the axis scale.
1015
\fIaxisId\fP axis index
1025
\fBQwtScaleDiv\fP, \fBsetAxisScaleDiv\fP
1030
Definition at line 235 of file qwt_plot_axis.cpp.
1032
References axisValid().
1034
Referenced by canvasMap(), QwtPlotPanner::moveCanvas(), print(), QwtPlotZoomer::rescale(), QwtPlotMagnifier::rescale(), QwtPlotPicker::scaleRect(), QwtPlotScaleItem::setScaleDivFromAxis(), QwtPlotScaleItem::setScaleDraw(), and updateAxes().
1035
.SS "\fBQwtScaleDiv\fP * QwtPlot::axisScaleDiv (int axisId)"
1037
Return the scale division of a specified axis.
1039
axisScaleDiv(axisId)->lBound(), axisScaleDiv(axisId)->hBound() are the current limits of the axis scale.
1043
\fIaxisId\fP axis index
1053
\fBQwtScaleDiv\fP, \fBsetAxisScaleDiv\fP
1058
Definition at line 254 of file qwt_plot_axis.cpp.
1060
References axisValid().
1061
.SS "const \fBQwtScaleDraw\fP * QwtPlot::axisScaleDraw (int axisId) const"
1065
the scale draw of a specified axis
1070
\fIaxisId\fP axis index
1075
specified scaleDraw for axis, or NULL if axis is invalid.
1085
Definition at line 268 of file qwt_plot_axis.cpp.
1087
References axisValid(), axisWidget(), and QwtScaleWidget::scaleDraw().
1088
.SS "\fBQwtScaleDraw\fP * QwtPlot::axisScaleDraw (int axisId)"
1092
the scale draw of a specified axis
1097
\fIaxisId\fP axis index
1102
specified scaleDraw for axis, or NULL if axis is invalid.
1112
Definition at line 282 of file qwt_plot_axis.cpp.
1114
References axisValid(), axisWidget(), and QwtScaleWidget::scaleDraw().
1115
.SS "const \fBQwtScaleWidget\fP * QwtPlot::axisWidget (int axisId) const"
1119
specified axis, or NULL if axisId is invalid.
1124
\fIaxisId\fP axis index
1129
Definition at line 100 of file qwt_plot_axis.cpp.
1131
References axisValid().
1133
Referenced by QwtPlotPrintFilter::apply(), axisFont(), axisScaleDraw(), axisTitle(), canvasMap(), QwtPlotLayout::minimumSizeHint(), print(), printScale(), QwtPlotPrintFilter::reset(), setAxisFont(), setAxisLabelRotation(), setAxisScaleDraw(), setAxisTitle(), sizeHint(), updateAxes(), and updateLayout().
1134
.SS "\fBQwtScaleWidget\fP * QwtPlot::axisWidget (int axisId)"
1138
specified axis, or NULL if axisId is invalid.
1143
\fIaxisId\fP axis index
1148
Definition at line 112 of file qwt_plot_axis.cpp.
1150
References axisValid().
1151
.SS "void QwtPlot::setAxisLabelAlignment (int axisId, Qt::Alignment alignment)"
1153
Change the alignment of the tick labels
1157
\fIaxisId\fP axis index
1159
\fIalignment\fP Or'd Qt::AlignmentFlags <see qnamespace.h>
1164
\fBQwtScaleDraw::setLabelAlignment()\fP
1169
Definition at line 483 of file qwt_plot_axis.cpp.
1170
.SS "void QwtPlot::setAxisLabelRotation (int axisId, double rotation)"
1172
Rotate all tick labels
1176
\fIaxisId\fP axis index
1178
\fIrotation\fP Angle in degrees. When changing the label rotation, the label alignment might be adjusted too.
1183
\fBQwtScaleDraw::setLabelRotation()\fP, \fBQwtPlot::setAxisLabelAlignment\fP
1188
Definition at line 497 of file qwt_plot_axis.cpp.
1190
References axisValid(), axisWidget(), and QwtScaleWidget::setLabelRotation().
1191
.SS "void QwtPlot::setAxisTitle (int axisId, const QString & title)"
1193
Change the title of a specified axis.
1197
\fIaxisId\fP axis index
1199
\fItitle\fP axis title
1204
Definition at line 561 of file qwt_plot_axis.cpp.
1206
References axisValid(), axisWidget(), and QwtScaleWidget::setTitle().
1207
.SS "void QwtPlot::setAxisTitle (int axisId, const \fBQwtText\fP & title)"
1209
Change the title of a specified axis.
1213
\fIaxisId\fP axis index
1215
\fItitle\fP axis title
1220
Definition at line 572 of file qwt_plot_axis.cpp.
1222
References axisValid(), axisWidget(), QwtScaleWidget::setTitle(), and title().
1223
.SS "\fBQwtText\fP QwtPlot::axisTitle (int axisId) const"
1227
the title of a specified axis
1232
\fIaxisId\fP axis index
1237
Definition at line 312 of file qwt_plot_axis.cpp.
1239
References axisValid(), axisWidget(), and QwtScaleWidget::title().
1240
.SS "void QwtPlot::setAxisMaxMinor (int axisId, int maxMinor)"
1242
Set the maximum number of minor scale intervals for a specified axis
1246
\fIaxisId\fP axis index
1248
\fImaxMinor\fP maximum number of minor steps
1253
\fBaxisMaxMinor()\fP
1258
Definition at line 510 of file qwt_plot_axis.cpp.
1260
References autoRefresh(), and axisValid().
1261
.SS "int QwtPlot::axisMaxMajor (int axisId) const"
1265
the maximum number of major ticks for a specified axis
1270
\fIaxisId\fP axis index sa \fBsetAxisMaxMajor()\fP
1275
Definition at line 203 of file qwt_plot_axis.cpp.
1277
References axisValid().
1278
.SS "void QwtPlot::setAxisMaxMajor (int axisId, int maxMajor)"
1280
Set the maximum number of major scale intervals for a specified axis
1284
\fIaxisId\fP axis index
1286
\fImaxMajor\fP maximum number of major steps
1291
\fBaxisMaxMajor()\fP
1296
Definition at line 537 of file qwt_plot_axis.cpp.
1298
References autoRefresh(), and axisValid().
1299
.SS "int QwtPlot::axisMaxMinor (int axisId) const"
1303
the maximum number of minor ticks for a specified axis
1308
\fIaxisId\fP axis index sa \fBsetAxisMaxMinor()\fP
1313
Definition at line 216 of file qwt_plot_axis.cpp.
1315
References axisValid().
1316
.SS "void QwtPlot::insertLegend (\fBQwtLegend\fP * legend, \fBQwtPlot::LegendPosition\fP pos = \fCQwtPlot::RightLegend\fP, double ratio = \fC-1.0\fP)"
1320
If the position legend is \fCQwtPlot::LeftLegend\fP or \fCQwtPlot::RightLegend\fP the legend will be organized in one column from top to down. Otherwise the legend items will be placed in a table with a best fit number of columns from left to right.
1322
If pos != QwtPlot::ExternalLegend the plot widget will become parent of the legend. It will be deleted when the plot is deleted, or another legend is set with \fBinsertLegend()\fP.
1328
\fIpos\fP The legend's position. For top/left position the number of colums will be limited to 1, otherwise it will be set to unlimited.
1330
\fIratio\fP Ratio between legend and the bounding rect of title, canvas and axes. The legend will be shrinked if it would need more space than the given ratio. The ratio is limited to ]0.0 .. 1.0]. In case of <= 0.0 it will be reset to the default ratio. The default vertical/horizontal ratio is 0.33/0.5.
1335
\fBlegend()\fP, \fBQwtPlotLayout::legendPosition()\fP, \fBQwtPlotLayout::setLegendPosition()\fP
1340
Definition at line 822 of file qwt_plot.cpp.
1342
References QwtPlotDict::itemList(), legend(), updateLayout(), and updateTabOrder().
1343
.SS "\fBQwtLegend\fP * QwtPlot::legend ()"
1352
\fBinsertLegend()\fP
1357
Definition at line 257 of file qwt_plot.cpp.
1359
Referenced by QwtPlotLayout::activate(), QwtPlotPrintFilter::apply(), insertLegend(), print(), printLegend(), and QwtPlotPrintFilter::reset().
1360
.SS "const \fBQwtLegend\fP * QwtPlot::legend () const"
1369
\fBinsertLegend()\fP
1374
Definition at line 266 of file qwt_plot.cpp.
1375
.SS "void QwtPlot::polish ()\fC [virtual]\fP"
1379
Definition at line 289 of file qwt_plot.cpp.
1381
References replot().
1383
Referenced by event().
1384
.SS "QSize QwtPlot::sizeHint () const\fC [virtual]\fP"
1390
\fBminimumSizeHint()\fP
1395
Definition at line 303 of file qwt_plot.cpp.
1397
References axisEnabled(), axisWidget(), minimumSizeHint(), QwtScaleWidget::minimumSizeHint(), QwtAbstractScaleDraw::scaleDiv(), QwtScaleWidget::scaleDraw(), and QwtScaleDiv::ticks().
1398
.SS "QSize QwtPlot::minimumSizeHint () const\fC [virtual]\fP"
1400
Return a minimum size hint.
1402
Definition at line 338 of file qwt_plot.cpp.
1404
Referenced by sizeHint().
1405
.SS "void QwtPlot::updateLayout ()\fC [virtual]\fP"
1407
Adjust plot content to its current size.
1416
Definition at line 413 of file qwt_plot.cpp.
1418
References axisEnabled(), and axisWidget().
1420
Referenced by enableAxis(), event(), insertLegend(), resizeEvent(), setCanvasLineWidth(), setMargin(), and setTitle().
1421
.SS "bool QwtPlot::event (QEvent *)\fC [virtual]\fP"
1423
Adds handling of layout requests.
1425
Definition at line 140 of file qwt_plot.cpp.
1427
References polish(), and updateLayout().
1428
.SS "void QwtPlot::legendClicked (\fBQwtPlotItem\fP * plotItem)\fC [signal]\fP"
1430
A signal which is emitted when the user has clicked on a legend item, which is in QwtLegend::ClickableItem mode.
1434
\fIplotItem\fP Corresponding plot item of the selected legend item
1439
clicks are disabled as default
1444
\fBQwtLegend::setItemMode\fP, \fBQwtLegend::itemMode\fP
1449
Referenced by legendItemClicked().
1450
.SS "void QwtPlot::legendChecked (\fBQwtPlotItem\fP * plotItem, bool on)\fC [signal]\fP"
1452
A signal which is emitted when the user has clicked on a legend item, which is in QwtLegend::CheckableItem mode
1456
\fIplotItem\fP Corresponding plot item of the selected legend item
1458
\fIon\fP True when the legen item is checked
1463
clicks are disabled as default
1468
\fBQwtLegend::setItemMode\fP, \fBQwtLegend::itemMode\fP
1473
Referenced by legendItemChecked().
1474
.SS "void QwtPlot::clear ()\fC [virtual, slot]\fP"
1476
Remove all curves and markers.
1478
Definition at line 789 of file qwt_plot.cpp.
1480
References QwtPlotDict::detachItems().
1481
.SS "void QwtPlot::replot ()\fC [virtual, slot]\fP"
1485
If the autoReplot option is not set (which is the default) or if any curves are attached to raw data, the plot has to be refreshed explicitly in order to make changes visible.
1489
\fBsetAutoReplot()\fP
1494
Calls \fBcanvas()\fP->repaint, take care of infinite recursions
1499
Definition at line 363 of file qwt_plot.cpp.
1501
References autoReplot(), canvas(), QwtPlotCanvas::invalidatePaintCache(), setAutoReplot(), QwtPlotCanvas::testPaintAttribute(), and updateAxes().
1503
Referenced by applyProperties(), autoRefresh(), QwtPlotPanner::moveCanvas(), polish(), QwtPlotZoomer::rescale(), QwtPlotMagnifier::rescale(), and QwtPlotZoomer::setZoomBase().
1504
.SS "void QwtPlot::autoRefresh ()\fC [slot]\fP"
1506
Replots the plot if \fBQwtPlot::autoReplot()\fP is \fCtrue\fP.
1508
Definition at line 163 of file qwt_plot.cpp.
1510
References replot().
1512
Referenced by setAxisAutoScale(), setAxisMaxMajor(), setAxisMaxMinor(), setAxisScale(), setAxisScaleDiv(), setAxisScaleDraw(), and setAxisScaleEngine().
1513
.SS "void QwtPlot::legendItemClicked ()\fC [protected, virtual, slot]\fP"
1515
Called internally when the legend has been clicked on. Emits a \fBlegendClicked()\fP signal.
1517
Definition at line 762 of file qwt_plot.cpp.
1519
References legendClicked().
1520
.SS "void QwtPlot::legendItemChecked (bool on)\fC [protected, virtual, slot]\fP"
1522
Called internally when the legend has been checked Emits a \fBlegendClicked()\fP signal.
1524
Definition at line 777 of file qwt_plot.cpp.
1526
References legendChecked().
1527
.SS "bool QwtPlot::axisValid (int axisId)\fC [static, protected]\fP"
1531
\fCtrue\fP if the specified axis exists, otherwise \fCfalse\fP
1536
\fIaxisId\fP axis index
1541
Definition at line 753 of file qwt_plot.cpp.
1543
Referenced by axisAutoScale(), axisEnabled(), axisFont(), axisMaxMajor(), axisMaxMinor(), axisScaleDiv(), axisScaleDraw(), axisScaleEngine(), axisStepSize(), axisTitle(), axisWidget(), enableAxis(), invTransform(), setAxisAutoScale(), setAxisFont(), setAxisLabelRotation(), setAxisMaxMajor(), setAxisMaxMinor(), setAxisScale(), setAxisScaleDiv(), setAxisScaleDraw(), setAxisScaleEngine(), setAxisTitle(), and transform().
1544
.SS "void QwtPlot::drawCanvas (QPainter * painter)\fC [protected, virtual]\fP"
1550
\fIpainter\fP Painter used for drawing
1555
drawCanvas calls drawItems what is also used for printing. Applications that like to add individual plot items better overload \fBdrawItems()\fP
1565
Definition at line 554 of file qwt_plot.cpp.
1567
References canvasMap(), and drawItems().
1568
.SS "void QwtPlot::drawItems (QPainter * painter, const QRect & rect, const \fBQwtScaleMap\fP map[axisCnt], const \fBQwtPlotPrintFilter\fP & pfilter) const\fC [protected, virtual]\fP"
1570
Redraw the canvas items.
1574
\fIpainter\fP Painter used for drawing
1576
\fIrect\fP Bounding rectangle where to paint
1578
\fImap\fP QwtPlot::axisCnt maps, mapping between plot and paint device coordinates
1580
\fIpfilter\fP Plot print filter
1585
Definition at line 572 of file qwt_plot.cpp.
1587
References QwtPlotDict::itemList(), and QwtPlotPrintFilter::options().
1589
Referenced by drawCanvas(), and printCanvas().
1590
.SS "void QwtPlot::updateTabOrder ()\fC [protected, virtual]\fP"
1592
Update the focus tab order
1594
The order is changed so that the canvas will be in front of the first legend item, or behind the last legend item - depending on the position of the legend.
1596
Definition at line 477 of file qwt_plot.cpp.
1598
Referenced by insertLegend().
1599
.SS "void QwtPlot::updateAxes ()\fC [protected]\fP"
1603
Definition at line 579 of file qwt_plot_axis.cpp.
1605
References axisAutoScale(), axisScaleDiv(), axisWidget(), QwtScaleWidget::getBorderDistHint(), QwtDoubleInterval::isValid(), QwtPlotDict::itemList(), QwtDoubleInterval::maxValue(), QwtDoubleInterval::minValue(), QwtScaleWidget::setBorderDist(), and QwtScaleWidget::setScaleDiv().
1607
Referenced by replot().
1608
.SS "void QwtPlot::resizeEvent (QResizeEvent * e)\fC [protected, virtual]\fP"
1610
Resize and update internal layout.
1612
Definition at line 347 of file qwt_plot.cpp.
1614
References updateLayout().
1615
.SS "void QwtPlot::printLegendItem (QPainter * painter, const QWidget * w, const QRect & rect) const\fC [protected, virtual]\fP"
1617
Print the legend item into a given rectangle.
1621
\fIpainter\fP Painter
1623
\fIw\fP Widget representing a legend item
1625
\fIrect\fP Bounding rectangle
1630
Definition at line 335 of file qwt_plot_print.cpp.
1632
Referenced by printLegend().
1633
.SS "void QwtPlot::printTitle (QPainter * painter, const QRect & rect) const\fC [protected, virtual]\fP"
1635
Print the title into a given rectangle.
1639
\fIpainter\fP Painter
1641
\fIrect\fP Bounding rectangle
1646
Definition at line 256 of file qwt_plot_print.cpp.
1648
References QwtText::draw(), QwtTextLabel::text(), and titleLabel().
1650
Referenced by print().
1651
.SS "void QwtPlot::printScale (QPainter * painter, int axisId, int startDist, int endDist, int baseDist, const QRect & rect) const\fC [protected, virtual]\fP"
1653
Paint a scale into a given rectangle. Paint the scale into a given rectangle.
1657
\fIpainter\fP Painter
1661
\fIstartDist\fP Start border distance
1663
\fIendDist\fP End border distance
1665
\fIbaseDist\fP Base distance
1667
\fIrect\fP Bounding rectangle
1672
Definition at line 359 of file qwt_plot_print.cpp.
1674
References axisEnabled(), axisWidget(), QwtScaleWidget::colorBarRect(), QwtScaleWidget::colorBarWidth(), QwtAbstractScaleDraw::draw(), QwtScaleWidget::drawColorBar(), QwtScaleWidget::drawTitle(), QwtScaleWidget::isColorBarEnabled(), QwtMetricsMap::layoutToScreen(), QwtScaleDraw::length(), QwtPainter::metricsMap(), QwtScaleDraw::move(), QwtScaleDraw::orientation(), QwtScaleWidget::penWidth(), QwtScaleDraw::pos(), QwtScaleWidget::scaleDraw(), QwtScaleDraw::setLength(), and QwtScaleWidget::spacing().
1676
Referenced by print().
1677
.SS "void QwtPlot::printCanvas (QPainter * painter, const QRect & boundingRect, const QRect & canvasRect, const \fBQwtScaleMap\fP map[axisCnt], const \fBQwtPlotPrintFilter\fP & pfilter) const\fC [protected, virtual]\fP"
1679
Print the canvas into a given rectangle.
1683
\fIpainter\fP Painter
1685
\fImap\fP Maps mapping between plot and paint device coordinates
1687
\fIboundingRect\fP Bounding rectangle
1689
\fIcanvasRect\fP Canvas rectangle
1691
\fIpfilter\fP Print filter
1696
\fBQwtPlotPrintFilter\fP
1701
Definition at line 467 of file qwt_plot_print.cpp.
1703
References canvas(), drawItems(), QwtPainter::drawRect(), QwtPainter::fillRect(), QwtPlotPrintFilter::options(), and QwtPainter::setClipRect().
1705
Referenced by print().
1706
.SS "void QwtPlot::printLegend (QPainter * painter, const QRect & rect) const\fC [protected, virtual]\fP"
1708
Print the legend into a given rectangle.
1712
\fIpainter\fP Painter
1714
\fIrect\fP Bounding rectangle
1719
Definition at line 280 of file qwt_plot_print.cpp.
1721
References QwtDynGridLayout::columnsForWidth(), QwtLegend::contentsWidget(), QwtDynGridLayout::count(), QwtDynGridLayout::itemAt(), QwtDynGridLayout::layoutItems(), legend(), printLegendItem(), and QwtPainter::setClipRect().
1723
Referenced by print().
1727
Generated automatically by Doxygen for Qwt User's Guide from the source code.