QwtPlotItem(3)
π QwtPlotItem β the Qwt User's Guide glow-up π
okay bestie, so this is QwtPlotItem(3) from the Qwt User's Guide, and it's literally the blueprint for every single thing that lives on your plot canvas. it's giving foundational. no cap.
β¨ NAME β¨
QwtPlotItem β (yeah the original leaves the one-liner blank, so we're matching energy π«Ά)
πΈ SYNOPSIS πΈ
#include <qwt_plot_item.h>
Inherits QwtLegendItemManager.
Inherited by QwtPlotCurve, QwtPlotGrid, QwtPlotMarker, QwtPlotRasterItem, QwtPlotScaleItem, and QwtPlotSvgItem.
π Public Types
enum ItemAttribute { Legend = 1, AutoScale = 2 }enum RenderHint { RenderAntialiased = 1 }enum RttiValues { Rtti_PlotItem = 0, Rtti_PlotGrid, Rtti_PlotScale, Rtti_PlotMarker, Rtti_PlotCurve, Rtti_PlotHistogram, Rtti_PlotSpectrogram, Rtti_PlotSVG, Rtti_PlotUserItem = 1000 }
π¦ Public Member Functions
QwtPlotItem (const QwtText &title=QwtText())virtual ~QwtPlotItem ()void attach (QwtPlot *plot)virtual QwtDoubleRect boundingRect () constvoid detach ()virtual void draw (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &canvasRect) const =0void hide ()QwtDoubleRect invTransform (const QwtScaleMap &, const QwtScaleMap &, const QRect &) constbool isVisible () constvirtual void itemChanged ()virtual QWidget * legendItem () constQRect paintRect (const QwtScaleMap &, const QwtScaleMap &) constQwtPlot * plot () constvirtual int rtti () constQwtDoubleRect scaleRect (const QwtScaleMap &, const QwtScaleMap &) constvoid setAxis (int xAxis, int yAxis)void setItemAttribute (ItemAttribute, bool on=true)void setRenderHint (RenderHint, bool on=true)void setTitle (const QString &title)void setTitle (const QwtText &title)virtual void setVisible (bool)void setXAxis (int axis)void setYAxis (int axis)void setZ (double z)void show ()bool testItemAttribute (ItemAttribute) constbool testRenderHint (RenderHint) constconst QwtText & title () constQRect transform (const QwtScaleMap &, const QwtScaleMap &, const QwtDoubleRect &) constvirtual void updateLegend (QwtLegend *) constvirtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &)int xAxis () constint yAxis () constdouble z () const
π Detailed Description π
Base class for items on the plot canvas.
so like⦠a plot item is "something" that can be painted on the plot canvas, or it can just be out here affecting the scales of the plot widget without ever showing its face. main character behavior, honestly. they come in two flavors:
- Representator β a "Representator" is an item that represents some sort of data on the plot canvas. the different representator classes are organized according to the characteristics of the data:
QwtPlotMarkerβ represents a point or a horizontal/vertical coordinate πQwtPlotCurveβ represents a series of points πQwtPlotSpectrogram(QwtPlotRasterItem) β represents raster data πΌοΈ...
- Decorators β a "Decorator" is an item that displays additional information that is not related to any data:
QwtPlotGridQwtPlotScaleItemQwtPlotSvgItem...
depending on the QwtPlotItem::ItemAttribute flags, an item gets included into autoscaling, or it gets an entry on the legnd. (yes, that typo is in the original, we keep it π
)
bestie, real talk: before you go misusing the existing item classes, it might be better to implement a new type of plot item. do not implement a watermark as a spectrogram, i'm begging π. deriving a new type ofQwtPlotItemprimarily means implementing theYourPlotItem::draw()method.
See also:
- The
cpuplotexample shows the implementation of additional plot items. π₯
π§ Member Enumeration Documentation π§
enum QwtPlotItem::ItemAttribute
Plot Item Attributes
Legendβ the item is represented on the legend. πAutoScaleβ theboundingRect()of the item is included in the autoscaling calculation. π
See also:
setItemAttribute(),testItemAttribute()
enum QwtPlotItem::RttiValues
Runtime type information. RttiValues is used to cast plot items, without having to enable runtime type information of the compiler. iconic, honestly β¨
π Constructor & Destructor Documentation π
QwtPlotItem::QwtPlotItem (const QwtText &title = QwtText()) [explicit]
Constructor β the moment of creation, the birth of your item π±
Parameters:
titleβ title of the item
π to be continued, bestie β more of this page is coming π
π Member Function Documentation π
β¨ void QwtPlotItem::attach (QwtPlot *plot) β¨
okay so bestie, this one attaches the item to a plot. It attaches a QwtPlotItem to the QwtPlot you pass as the argument. First it detaches the QwtPlotItem from any plot from a previous call to attach if necessary. If you pass a NULL argument, it detaches from any QwtPlot it was attached to.
plotβ Plot widget
See also: QwtPlotItem::detach()
πΈ QwtDoubleRect QwtPlotItem::boundingRect () const [virtual] πΈ
Returns an invalid bounding rect: QwtDoubleRect(1.0, 1.0, -2.0, -2.0).
Reimplemented in QwtPlotCurve, QwtPlotMarker, QwtPlotSpectrogram, and QwtPlotSvgItem.
π void QwtPlotItem::detach () [inline] π
This method detaches a QwtPlotItem from any QwtPlot it has been associated with. detach() is equivalent to calling attach( NULL ).
See also: attach( QwtPlot* plot )
π¦ virtual void QwtPlotItem::draw (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &canvasRect) const [pure virtual] π¦
Draw the item.
painterβ PainterxMapβ Maps x-values into pixel coordinates.yMapβ Maps y-values into pixel coordinates.canvasRectβ Contents rect of the canvas in painter coordinates
Implemented in QwtPlotCurve, QwtPlotMarker, QwtPlotScaleItem, QwtPlotSpectrogram, QwtPlotRasterItem, QwtPlotGrid, and QwtPlotSvgItem.
π QwtDoubleRect QwtPlotItem::invTransform (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &rect) const π
Transform a rectangle from paint to scale coordinates.
xMapβ X mapyMapβ Y maprectβ Rectangle in paint coordinates
Returns: Rectangle in scale coordinates
See also: transform()
β¨ bool QwtPlotItem::isVisible () const β¨
Returns: true if visible
See also: setVisible(), show(), hide()
π₯ void QwtPlotItem::itemChanged () [virtual] π₯
Update the legend and call QwtPlot::autoRefresh for the parent plot.
See also: updateLegend()
π QWidget * QwtPlotItem::legendItem () const [virtual] π
Allocate the widget that represents the item on the legend. The default implementation is made for QwtPlotCurve and returns a QwtLegendItem(), but an item could be represented by any type of widget, by overloading legendItem() and updateLegend().
Returns: QwtLegendItem()
See also: updateLegend() QwtLegend()
Implements QwtLegendItemManager.
π QRect QwtPlotItem::paintRect (const QwtScaleMap &xMap, const QwtScaleMap &yMap) const π
Calculate the bounding paint rect of 2 maps.
xMapβ X mapyMapβ X map
Returns: Bounding rect of the scale maps
β int QwtPlotItem::rtti () const [virtual] β
Return rtti for the specific class represented. QwtPlotItem is simply a virtual interface class, and base classes will implement this method with specific rtti values so a user can differentiate them.
The rtti value is useful for environments, where the runtime type information is disabled and it is not possible to do a dynamic_cast<...>.
Returns: rtti value
See also: RttiValues
Reimplemented in QwtPlotCurve, QwtPlotSpectrogram, QwtPlotMarker, QwtPlotScaleItem, QwtPlotSvgItem, and QwtPlotGrid.
π QwtDoubleRect QwtPlotItem::scaleRect (const QwtScaleMap &xMap, const QwtScaleMap &yMap) const π
Calculate the bounding scale rect of 2 maps.
xMapβ X mapyMapβ X map
Returns: Bounding rect of the scale maps
π
void QwtPlotItem::setAxis (intxAxis, intyAxis) π
Set X and Y axis.
The item will painted according to the coordinates its Axes.
xAxisβ X AxisyAxisβ Y Axis
See also: setXAxis(), setYAxis(), xAxis(), yAxis()
π§ void QwtPlotItem::setItemAttribute (ItemAttributeattribute, boolon = true) π§
Toggle an item attribute.
attributeβ Attribute typeonβ true/false
See also: testItemAttribute(), ItemAttribute
πΈ void QwtPlotItem::setRenderHint (RenderHinthint, boolon = true) πΈ
Toggle an render hint.
hintβ Render hintonβ true/false
See also: testRenderHint(), RenderHint
π void QwtPlotItem::setTitle (const QString &title) π
Set a new title.
titleβ Title
See also: title()
π void QwtPlotItem::setTitle (const QwtText &title) π
Set a new title.
titleβ Title
See also: title()
β¨ void QwtPlotItem::setVisible (boolon) [virtual] β¨
Show/Hide the item.
onβ Show if true, otherwise hide
See also: isVisible(), show(), hide()
π void QwtPlotItem::setXAxis (intaxis) π
Set the X axis.
The item will painted according to the coordinates its Axes.
axisβ X Axis
See also: setAxis(), setYAxis(), xAxis()
π void QwtPlotItem::setYAxis (intaxis) π
Set the Y axis.
The item will painted according to the coordinates its Axes.
axisβ Y Axis
See also: setAxis(), setXAxis(), yAxis()
π₯ void QwtPlotItem::setZ (doublez) π₯
Set the z value. Plot items are painted in increasing z-order.
zβ Z-value
See also: z(), QwtPlotDict::itemList()
π bool QwtPlotItem::testItemAttribute (ItemAttributeattribute) const π
Test an item attribute.
attributeβ Attribute type
Returns: true/false
See also: setItemAttribute(), ItemAttribute
π bool QwtPlotItem::testRenderHint (RenderHinthint) const π
Test a render hint.
hintβ Render hint
Returns: true/false
See also: setRenderHint(), RenderHint
π const QwtText & QwtPlotItem::title () const π
Returns: Title of the item
See also: setTitle()
π QRect QwtPlotItem::transform (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtDoubleRect &rect) const π
Transform a rectangle.
xMapβ X mapyMapβ Y maprectβ Rectangle in scale coordinates
Returns: Rectangle in paint coordinates
See also: invTransform()
π void QwtPlotItem::updateLegend (QwtLegend *legend) const [virtual] π
Update the widget that represents the item on the legend. updateLegend() is called from itemChanged() to adopt the widget representing the item on the legend to its new configuration.
The default implementation is made for QwtPlotCurve and updates a QwtLegendItem(), but an item could be represented by any type of widget, by overloading legendItem() and updateLegend().
legendβ Legend
See also: legendItem(), itemChanged(), QwtLegend()
Implements QwtLegendItemManager.
Reimplemented in QwtPlotCurve.
π¦ void QwtPlotItem::updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) [virtual] π¦
Update the item to changes of the axes scale division. 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 updateScaleDiv().
xScaleDivβ Scale division of the x-axisyScaleDivβ Scale division of the y-axis
See also: QwtPlot::updateAxes()
Reimplemented in QwtPlotScaleItem, and QwtPlotGrid.
β double QwtPlotItem::z () const β
Plot items are painted in increasing z-order.
Returns: setZ(), QwtPlotDict::itemList()
π Author π
Generated automatically by Doxygen for Qwt User's Guide from the source code.
π okay bestie, that's the whole vibe from Version 5.2.3, dated Tue Nov 20 2012 β QwtPlotItem(3), and we ate. Periodt. π
π¦ where this page comes from
- epel 9: qwt5-qt5-devel 5.2.3a-12.20210522gita2b11e3.el9 Β· LGPLv2+ with exceptions
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms