1
.TH "QwtPlotItem" 3 "22 Mar 2009" "Version 5.1.2" "Qwt User's Guide" \" -*- nroff -*-
9
Inherits \fBQwtLegendItemManager\fP.
11
Inherited by \fBQwtPlotCurve\fP, \fBQwtPlotGrid\fP, \fBQwtPlotMarker\fP, \fBQwtPlotRasterItem\fP, \fBQwtPlotScaleItem\fP, and \fBQwtPlotSvgItem\fP.
13
.SH "Detailed Description"
15
Base class for items on the plot canvas.
17
Definition at line 31 of file qwt_plot_item.h.
22
.RI "enum \fBRttiValues\fP { \fBRtti_PlotItem\fP = 0, \fBRtti_PlotGrid\fP, \fBRtti_PlotScale\fP, \fBRtti_PlotMarker\fP, \fBRtti_PlotCurve\fP, \fBRtti_PlotHistogram\fP, \fBRtti_PlotSpectrogram\fP, \fBRtti_PlotSVG\fP, \fBRtti_PlotUserItem\fP = 1000 }"
25
.RI "enum \fBItemAttribute\fP { \fBLegend\fP = 1, \fBAutoScale\fP = 2 }"
28
.RI "enum \fBRenderHint\fP { \fBRenderAntialiased\fP = 1 }"
31
.SS "Public Member Functions"
35
.RI "\fBQwtPlotItem\fP (const \fBQwtText\fP &title=\fBQwtText\fP())"
38
.RI "virtual \fB~QwtPlotItem\fP ()"
41
.RI "void \fBattach\fP (\fBQwtPlot\fP *plot)"
44
.RI "void \fBdetach\fP ()"
47
.RI "\fBQwtPlot\fP * \fBplot\fP () const"
50
.RI "void \fBsetTitle\fP (const QString &title)"
53
.RI "void \fBsetTitle\fP (const \fBQwtText\fP &title)"
56
.RI "const \fBQwtText\fP & \fBtitle\fP () const"
59
.RI "virtual int \fBrtti\fP () const"
62
.RI "void \fBsetItemAttribute\fP (\fBItemAttribute\fP, bool on=true)"
65
.RI "bool \fBtestItemAttribute\fP (\fBItemAttribute\fP) const "
68
.RI "void \fBsetRenderHint\fP (\fBRenderHint\fP, bool on=true)"
71
.RI "bool \fBtestRenderHint\fP (\fBRenderHint\fP) const"
74
.RI "double \fBz\fP () const"
77
.RI "void \fBsetZ\fP (double z)"
80
.RI "void \fBshow\fP ()"
83
.RI "void \fBhide\fP ()"
86
.RI "virtual void \fBsetVisible\fP (bool)"
89
.RI "bool \fBisVisible\fP () const"
92
.RI "void \fBsetAxis\fP (int xAxis, int yAxis)"
95
.RI "void \fBsetXAxis\fP (int axis)"
98
.RI "int \fBxAxis\fP () const"
101
.RI "void \fBsetYAxis\fP (int axis)"
104
.RI "int \fByAxis\fP () const"
107
.RI "virtual void \fBitemChanged\fP ()"
110
.RI "virtual void \fBdraw\fP (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRect &canvasRect) const=0"
113
.RI "virtual \fBQwtDoubleRect\fP \fBboundingRect\fP () const"
116
.RI "virtual void \fBupdateLegend\fP (\fBQwtLegend\fP *) const "
119
.RI "virtual void \fBupdateScaleDiv\fP (const \fBQwtScaleDiv\fP &, const \fBQwtScaleDiv\fP &)"
122
.RI "virtual QWidget * \fBlegendItem\fP () const"
125
.RI "\fBQwtDoubleRect\fP \fBscaleRect\fP (const \fBQwtScaleMap\fP &, const \fBQwtScaleMap\fP &) const"
128
.RI "QRect \fBpaintRect\fP (const \fBQwtScaleMap\fP &, const \fBQwtScaleMap\fP &) const"
131
.RI "QRect \fBtransform\fP (const \fBQwtScaleMap\fP &, const \fBQwtScaleMap\fP &, const \fBQwtDoubleRect\fP &) const"
134
.RI "\fBQwtDoubleRect\fP \fBinvTransform\fP (const \fBQwtScaleMap\fP &, const \fBQwtScaleMap\fP &, const QRect &) const"
137
.SH "Constructor & Destructor Documentation"
139
.SS "QwtPlotItem::QwtPlotItem (const \fBQwtText\fP & title = \fC\fBQwtText\fP()\fP)\fC [explicit]\fP"
143
Definition at line 48 of file qwt_plot_item.cpp.
146
.SS "QwtPlotItem::~QwtPlotItem ()\fC [virtual]\fP"
148
Destroy the \fBQwtPlotItem\fP.
150
Definition at line 55 of file qwt_plot_item.cpp.
153
.SH "Member Function Documentation"
155
.SS "void QwtPlotItem::attach (\fBQwtPlot\fP * plot)"
157
Attach the item to a plot.
159
This method will attach a \fBQwtPlotItem\fP to the \fBQwtPlot\fP argument. It will first detach the \fBQwtPlotItem\fP from any plot from a previous call to attach (if necessary). If a NULL argument is passed, it will detach from any \fBQwtPlot\fP it was attached to.
163
\fBQwtPlotItem::detach()\fP
168
Definition at line 71 of file qwt_plot_item.cpp.
170
References itemChanged(), legendItem(), and plot().
172
Referenced by ~QwtPlotItem().
173
.SS "void QwtPlotItem::detach ()\fC [inline]\fP"
175
This method detaches a \fBQwtPlotItem\fP from any \fBQwtPlot\fP it has been associated with.
177
\fBdetach()\fP is equivalent to calling attach( NULL )
181
\fBattach( QwtPlot* plot )\fP
186
Definition at line 74 of file qwt_plot_item.h.
187
.SS "\fBQwtPlot\fP * QwtPlotItem::plot () const"
189
Return attached plot.
191
Definition at line 122 of file qwt_plot_item.cpp.
193
Referenced by attach(), QwtPlotCurve::closestPoint(), QwtPlotCurve::draw(), QwtPlotScaleItem::setScaleDivFromAxis(), and QwtPlotScaleItem::setScaleDraw().
194
.SS "void QwtPlotItem::setTitle (const QString & title)"
210
Definition at line 166 of file qwt_plot_item.cpp.
211
.SS "void QwtPlotItem::setTitle (const \fBQwtText\fP & title)"
227
Definition at line 177 of file qwt_plot_item.cpp.
229
References itemChanged(), and title().
230
.SS "const \fBQwtText\fP & QwtPlotItem::title () const"
244
Definition at line 190 of file qwt_plot_item.cpp.
246
Referenced by QwtPlotItem(), setTitle(), and QwtPlotCurve::updateLegend().
247
.SS "int QwtPlotItem::rtti () const\fC [virtual]\fP"
249
Return rtti for the specific class represented. \fBQwtPlotItem\fP is simply a virtual interface class, and base classes will implement this method with specific rtti values so a user can differentiate them.
251
The rtti value is useful for environments, where the runtime type information is disabled and it is not possible to do a dynamic_cast<...>.
265
Reimplemented in \fBQwtPlotCurve\fP, \fBQwtPlotGrid\fP, \fBQwtPlotMarker\fP, \fBQwtPlotScaleItem\fP, \fBQwtPlotSpectrogram\fP, and \fBQwtPlotSvgItem\fP.
267
Definition at line 116 of file qwt_plot_item.cpp.
269
Referenced by QwtPlotPrintFilter::apply(), and QwtPlotPrintFilter::reset().
270
.SS "void QwtPlotItem::setItemAttribute (\fBItemAttribute\fP attribute, bool on = \fCtrue\fP)"
272
Toggle an item attribute
276
\fIattribute\fP Attribute type
283
\fBtestItemAttribute()\fP, \fBItemAttribute\fP
288
Definition at line 203 of file qwt_plot_item.cpp.
290
References itemChanged().
292
Referenced by QwtPlotCurve::init(), and QwtPlotSpectrogram::QwtPlotSpectrogram().
293
.SS "bool QwtPlotItem::testItemAttribute (\fBItemAttribute\fP attribute) const"
295
Test an item attribute
299
\fIItemAttribute\fP Attribute type
309
\fBsetItemAttribute()\fP, \fBItemAttribute\fP
314
Definition at line 223 of file qwt_plot_item.cpp.
316
Referenced by updateLegend().
317
.SS "void QwtPlotItem::setRenderHint (\fBRenderHint\fP hint, bool on = \fCtrue\fP)"
319
Toggle an render hint
323
\fIhint\fP Render hint
330
\fBtestRenderHint()\fP, \fBRenderHint\fP
335
Definition at line 238 of file qwt_plot_item.cpp.
337
References itemChanged().
338
.SS "bool QwtPlotItem::testRenderHint (\fBRenderHint\fP hint) const"
344
\fIhint\fP Render hint
354
\fBsetRenderHint()\fP, \fBRenderHint\fP
359
Definition at line 258 of file qwt_plot_item.cpp.
360
.SS "double QwtPlotItem::z () const"
362
Plot items are painted in increasing z-order.
366
\fBsetZ()\fP, \fBQwtPlotDict::itemList()\fP
371
Definition at line 132 of file qwt_plot_item.cpp.
372
.SS "void QwtPlotItem::setZ (double z)"
376
Plot items are painted in increasing z-order.
385
\fBz()\fP, \fBQwtPlotDict::itemList()\fP
390
Definition at line 145 of file qwt_plot_item.cpp.
392
References itemChanged().
394
Referenced by QwtPlotCurve::init(), QwtPlotGrid::QwtPlotGrid(), QwtPlotMarker::QwtPlotMarker(), QwtPlotScaleItem::QwtPlotScaleItem(), and QwtPlotSpectrogram::QwtPlotSpectrogram().
395
.SS "void QwtPlotItem::show ()"
399
Definition at line 266 of file qwt_plot_item.cpp.
401
References setVisible().
402
.SS "void QwtPlotItem::hide ()"
406
Definition at line 272 of file qwt_plot_item.cpp.
408
References setVisible().
409
.SS "void QwtPlotItem::setVisible (bool on)\fC [virtual]\fP"
415
\fIon\fP Show if true, otherwise hide
420
\fBisVisible()\fP, \fBshow()\fP, \fBhide()\fP
425
Definition at line 283 of file qwt_plot_item.cpp.
427
References itemChanged().
429
Referenced by hide(), and show().
430
.SS "bool QwtPlotItem::isVisible () const"
439
\fBsetVisible()\fP, \fBshow()\fP, \fBhide()\fP
444
Definition at line 296 of file qwt_plot_item.cpp.
445
.SS "void QwtPlotItem::setAxis (int xAxis, int yAxis)"
449
The item will painted according to the coordinates its Axes.
460
\fBsetXAxis()\fP, \fBsetYAxis()\fP, \fBxAxis()\fP, \fByAxis()\fP
465
Definition at line 328 of file qwt_plot_item.cpp.
467
References itemChanged().
468
.SS "void QwtPlotItem::setXAxis (int axis)"
472
The item will painted according to the coordinates its Axes.
481
\fBsetAxis()\fP, \fBsetYAxis()\fP, \fBxAxis()\fP
486
Definition at line 347 of file qwt_plot_item.cpp.
488
References itemChanged().
489
.SS "int QwtPlotItem::xAxis () const"
493
Definition at line 374 of file qwt_plot_item.cpp.
495
Referenced by QwtPlotCurve::closestPoint(), QwtPlotCurve::draw(), QwtPlotScaleItem::setScaleDivFromAxis(), and QwtPlotScaleItem::setScaleDraw().
496
.SS "void QwtPlotItem::setYAxis (int axis)"
500
The item will painted according to the coordinates its Axes.
509
\fBsetAxis()\fP, \fBsetXAxis()\fP, \fByAxis()\fP
514
Definition at line 364 of file qwt_plot_item.cpp.
516
References itemChanged().
517
.SS "int QwtPlotItem::yAxis () const"
521
Definition at line 380 of file qwt_plot_item.cpp.
523
Referenced by QwtPlotCurve::closestPoint(), QwtPlotCurve::draw(), QwtPlotScaleItem::setScaleDivFromAxis(), and QwtPlotScaleItem::setScaleDraw().
524
.SS "void QwtPlotItem::itemChanged ()\fC [virtual]\fP"
526
Update the legend and call \fBQwtPlot::autoRefresh\fP for the parent plot.
535
Definition at line 307 of file qwt_plot_item.cpp.
537
References updateLegend().
539
Referenced by attach(), QwtPlotGrid::enableX(), QwtPlotGrid::enableXMin(), QwtPlotGrid::enableY(), QwtPlotGrid::enableYMin(), QwtPlotSvgItem::loadData(), QwtPlotSvgItem::loadFile(), QwtPlotScaleItem::setAlignment(), QwtPlotRasterItem::setAlpha(), setAxis(), QwtPlotCurve::setBaseline(), QwtPlotScaleItem::setBorderDistance(), QwtPlotCurve::setBrush(), QwtPlotRasterItem::setCachePolicy(), QwtPlotSpectrogram::setColorMap(), QwtPlotSpectrogram::setConrecAttribute(), QwtPlotSpectrogram::setContourLevels(), QwtPlotCurve::setCurveAttribute(), QwtPlotCurve::setCurveFitter(), QwtPlotCurve::setCurveType(), QwtPlotSpectrogram::setData(), QwtPlotCurve::setData(), QwtPlotSpectrogram::setDefaultContourPen(), QwtPlotSpectrogram::setDisplayMode(), QwtPlotScaleItem::setFont(), setItemAttribute(), QwtPlotMarker::setLabel(), QwtPlotMarker::setLinePen(), QwtPlotMarker::setLineStyle(), QwtPlotGrid::setMajPen(), QwtPlotGrid::setMinPen(), QwtPlotScaleItem::setPalette(), QwtPlotGrid::setPen(), QwtPlotCurve::setPen(), QwtPlotScaleItem::setPosition(), QwtPlotCurve::setRawData(), setRenderHint(), QwtPlotScaleItem::setScaleDivFromAxis(), QwtPlotScaleItem::setScaleDraw(), QwtPlotCurve::setStyle(), QwtPlotMarker::setSymbol(), QwtPlotCurve::setSymbol(), setTitle(), QwtPlotMarker::setValue(), setVisible(), setXAxis(), QwtPlotGrid::setXDiv(), setYAxis(), QwtPlotGrid::setYDiv(), and setZ().
540
.SS "virtual void QwtPlotItem::draw (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const QRect & canvasRect) const\fC [pure virtual]\fP"
546
\fIpainter\fP Painter
548
\fIxMap\fP Maps x-values into pixel coordinates.
550
\fIyMap\fP Maps y-values into pixel coordinates.
552
\fIcanvasRect\fP Contents rect of the canvas in painter coordinates
557
Implemented in \fBQwtPlotCurve\fP, \fBQwtPlotGrid\fP, \fBQwtPlotMarker\fP, \fBQwtPlotRasterItem\fP, \fBQwtPlotScaleItem\fP, \fBQwtPlotSpectrogram\fP, and \fBQwtPlotSvgItem\fP.
558
.SS "\fBQwtDoubleRect\fP QwtPlotItem::boundingRect () const\fC [virtual]\fP"
562
An invalid bounding rect: QwtDoubleRect(1.0, 1.0, -2.0, -2.0)
567
Reimplemented in \fBQwtPlotCurve\fP, \fBQwtPlotMarker\fP, \fBQwtPlotSpectrogram\fP, and \fBQwtPlotSvgItem\fP.
569
Definition at line 388 of file qwt_plot_item.cpp.
571
Referenced by QwtPlotRasterItem::draw(), QwtPlotCurve::maxXValue(), QwtPlotCurve::maxYValue(), QwtPlotCurve::minXValue(), and QwtPlotCurve::minYValue().
572
.SS "void QwtPlotItem::updateLegend (\fBQwtLegend\fP * legend) const\fC [virtual]\fP"
574
Update the widget that represents the item on the legend.
576
\fBupdateLegend()\fP is called from \fBitemChanged()\fP to adopt the widget representing the item on the legend to its new configuration.
578
The default implementation is made for \fBQwtPlotCurve\fP and updates a QwtLegendItem(), but an item could be represented by any type of widget, by overloading \fBlegendItem()\fP and \fBupdateLegend()\fP.
582
\fBlegendItem()\fP, \fBitemChanged()\fP, QwtLegend()
587
Implements \fBQwtLegendItemManager\fP.
589
Reimplemented in \fBQwtPlotCurve\fP.
591
Definition at line 420 of file qwt_plot_item.cpp.
593
References QwtLegend::find(), QwtLegend::insert(), QwtLegend::itemMode(), legendItem(), and testItemAttribute().
595
Referenced by itemChanged(), and QwtPlotCurve::updateLegend().
596
.SS "void QwtPlotItem::updateScaleDiv (const \fBQwtScaleDiv\fP &, const \fBQwtScaleDiv\fP &)\fC [virtual]\fP"
598
Update the item to changes of the axes scale division.
600
Update the item, when the axes of plot have changed. The default implementation does nothing, but items that depend on the scale division (like QwtPlotGrid()) have to reimplement \fBupdateScaleDiv()\fP
604
\fIxScaleDiv\fP Scale division of the x-axis
606
\fIyScaleDiv\fP Scale division of the y-axis
611
\fBQwtPlot::updateAxes()\fP
616
Reimplemented in \fBQwtPlotGrid\fP, and \fBQwtPlotScaleItem\fP.
618
Definition at line 475 of file qwt_plot_item.cpp.
619
.SS "QWidget * QwtPlotItem::legendItem () const\fC [virtual]\fP"
621
Allocate the widget that represents the item on the legend.
623
The default implementation is made for \fBQwtPlotCurve\fP and returns a QwtLegendItem(), but an item could be represented by any type of widget, by overloading \fBlegendItem()\fP and \fBupdateLegend()\fP.
632
\fBupdateLegend()\fP QwtLegend()
637
Implements \fBQwtLegendItemManager\fP.
639
Definition at line 403 of file qwt_plot_item.cpp.
641
Referenced by attach(), updateLegend(), and QwtPlotCurve::updateLegend().
642
.SS "\fBQwtDoubleRect\fP QwtPlotItem::scaleRect (const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap) const"
644
Calculate the bounding scale rect of 2 maps.
655
Bounding rect of the scale maps
660
Definition at line 488 of file qwt_plot_item.cpp.
662
References QwtScaleMap::s1(), and QwtScaleMap::sDist().
663
.SS "QRect QwtPlotItem::paintRect (const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap) const"
665
Calculate the bounding paint rect of 2 maps.
676
Bounding rect of the scale maps
681
Definition at line 503 of file qwt_plot_item.cpp.
683
References QwtScaleMap::p1(), and QwtScaleMap::pDist().
685
Referenced by QwtPlotRasterItem::draw().
686
.SS "QRect QwtPlotItem::transform (const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const \fBQwtDoubleRect\fP & rect) const"
688
Transform a rectangle
696
\fIrect\fP Rectangle in scale coordinates
701
Rectangle in paint coordinates
711
Definition at line 522 of file qwt_plot_item.cpp.
713
References QwtScaleMap::transform().
715
Referenced by QwtPlotSvgItem::draw(), QwtPlotSpectrogram::draw(), QwtPlotRasterItem::draw(), and QwtPlotSpectrogram::renderImage().
716
.SS "\fBQwtDoubleRect\fP QwtPlotItem::invTransform (const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const QRect & rect) const"
718
Transform a rectangle from paint to scale coordinates
726
\fIrect\fP Rectangle in paint coordinates
731
Rectangle in scale coordinates
741
Definition at line 547 of file qwt_plot_item.cpp.
743
References QwtScaleMap::invTransform().
745
Referenced by QwtPlotSvgItem::draw(), QwtPlotSpectrogram::draw(), and QwtPlotRasterItem::draw().
749
Generated automatically by Doxygen for Qwt User's Guide from the source code.