QwtPlotScaleItem(3)
πΈ NAME πΈ
okay bestie, this is QwtPlotScaleItem(3) from the Library Functions Manual β literally a class which draws a scale inside the plot canvas. That's the whole vibe. π
β¨
π¦ SYNOPSIS π¦
#include <qwt_plot_scaleitem.h>
Inherits QwtPlotItem.
π Public Member Functions π
QwtPlotScaleItem (QwtScaleDraw::Alignment=QwtScaleDraw::BottomScale, const double pos=0.0)β constructor for a scale item at the positionpos. π«Άvirtual ~QwtPlotScaleItem ()β destructor. bye-bye, scale item πvirtual int rtti () const overridevoid setScaleDiv (const QwtScaleDiv &)β assign a scale division.const QwtScaleDiv & scaleDiv () constvoid setScaleDivFromAxis (bool on)bool isScaleDivFromAxis () constvoid setPalette (const QPalette &)QPalette palette () constvoid setFont (const QFont &)QFont font () constvoid setScaleDraw (QwtScaleDraw *)β set a scale draw.const QwtScaleDraw * scaleDraw () constQwtScaleDraw * scaleDraw ()void setPosition (double pos)double position () constvoid setBorderDistance (int)β align the scale to the canvas.int borderDistance () constvoid setAlignment (QwtScaleDraw::Alignment)virtual void draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const overrideβ draw the scale.virtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) overrideβ update the item to changes of the axes scale division.
π Public Member Functions inherited from QwtPlotItem π
QwtPlotItem ()QwtPlotItem (const QString &title)QwtPlotItem (const QwtText &title)virtual ~QwtPlotItem ()β destroy theQwtPlotItem.void attach (QwtPlot *plot)β attach the item to a plot.void detach ()β this method detaches aQwtPlotItemfrom anyQwtPlotit has been associated with.QwtPlot * plot () constβ return attached plot.void setTitle (const QString &title)void setTitle (const QwtText &title)const QwtText & title () constvoid setItemAttribute (ItemAttribute, bool on=true)bool testItemAttribute (ItemAttribute) constvoid setItemInterest (ItemInterest, bool on=true)bool testItemInterest (ItemInterest) constvoid setRenderHint (RenderHint, bool on=true)bool testRenderHint (RenderHint) constvoid setRenderThreadCount (uint numThreads)uint renderThreadCount () constvoid setLegendIconSize (const QSize &)QSize legendIconSize () constdouble z () constvoid setZ (double z)β set the z value.void show ()β show the item.void hide ()β hide the item.virtual void setVisible (bool)bool isVisible () constvoid setAxes (QwtAxisId xAxis, QwtAxisId yAxis)void setXAxis (QwtAxisId)QwtAxisId xAxis () constβ return xAxis.void setYAxis (QwtAxisId)QwtAxisId yAxis () constβ return yAxis.virtual void itemChanged ()virtual void legendChanged ()virtual QRectF boundingRect () constvirtual void getCanvasMarginHint (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) constβ calculate a hint for the canvas margin.virtual void updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &)β update the item to changes of the legend info.QRectF scaleRect (const QwtScaleMap &, const QwtScaleMap &) constβ calculate the bounding scale rectangle of 2 maps.QRectF paintRect (const QwtScaleMap &, const QwtScaleMap &) constβ calculate the bounding paint rectangle of 2 maps.virtual QList< QwtLegendData > legendData () constβ return all information, that is needed to represent the item on the legend.virtual QwtGraphic legendIcon (int index, const QSizeF &) const
π§ Additional Inherited Members π§
π Public Types inherited from QwtPlotItem π
enum RttiValues { Rtti_PlotItem = 0, Rtti_PlotGrid, Rtti_PlotScale, Rtti_PlotLegend, Rtti_PlotMarker, Rtti_PlotCurve, Rtti_PlotSpectroCurve, Rtti_PlotIntervalCurve, Rtti_PlotHistogram, Rtti_PlotSpectrogram, Rtti_PlotGraphic, Rtti_PlotTradingCurve, Rtti_PlotBarChart, Rtti_PlotMultiBarChart, Rtti_PlotShape, Rtti_PlotTextLabel, Rtti_PlotZone, Rtti_PlotVectorField, Rtti_PlotUserItem = 1000 }
Runtime type information. π
enum ItemAttribute { Legend = 0x01, AutoScale = 0x02, Margins = 0x04 }
Plot Item Attributes. π
enum ItemInterest { ScaleInterest = 0x01, LegendInterest = 0x02 }
Plot Item Interests. π
enum RenderHint { RenderAntialiased = 0x1 }
Render hints. β¨
typedef QFlags< ItemAttribute > ItemAttributes
typedef QFlags< ItemInterest > ItemInterests
typedef QFlags< RenderHint > RenderHints
π‘ Protected Member Functions inherited from QwtPlotItem π‘
QwtGraphic defaultIcon (const QBrush &, const QSizeF &) constβ return a default icon from a brush.
β¨ Detailed Description β¨
This class draws a scale inside the plot canvas. That's the whole main-character energy. π
QwtPlotScaleItem can be used to draw an axis inside the plot canvas. It might be synchronized to one of the axes of the plot, but it can also display its own ticks and labels. π¦
It is allowed to synchronize the scale item with a disabled axis. In plots with vertical and horizontal scale items, it might be necessary to remove ticks at the intersections, by overloading updateScaleDiv(). π
The scale might be at a specific position (for example 0.0) or it might be aligned to a canvas border. πΈ
π Example π
The following example shows how to replace the left axis, by a scale item at the x position 0.0.
QwtPlotScaleItem *scaleItem = new QwtPlotScaleItem( QwtScaleDraw::RightScale, 0.0 );
scaleItem->setFont( plot->axisWidget( QwtAxis::YLeft )->font() );
scaleItem->attach(plot);
plot->setAxisVisible( QwtAxis::YLeft, false );
Definition at line 46 of file qwt_plot_scaleitem.h. π
π Constructor & Destructor Documentation π
π QwtPlotScaleItem::QwtPlotScaleItem π
QwtPlotScaleItem::QwtPlotScaleItem (QwtScaleDraw::Alignment alignment =
QwtScaleDraw::BottomScale, const double pos = 0.0) [explicit]
Constructor for scale item at the position pos. π«Ά
Parameters
- alignment β in case of
QwtScaleDraw::BottomScaleorQwtScaleDraw::TopScalethe scale item is corresponding to thexAxis(), otherwise it corresponds to theyAxis(). - pos β x or y position, depending on the corresponding axis.
See also
setPosition(), setAlignment()
Definition at line 75 of file qwt_plot_scaleitem.cpp. β¨
π QwtPlotScaleItem::~QwtPlotScaleItem π
QwtPlotScaleItem::~QwtPlotScaleItem () [virtual]
Destructor.
Definition at line 88 of file qwt_plot_scaleitem.cpp. π
π Member Function Documentation π
π
int QwtPlotScaleItem::borderDistance () const
Returns the Distance from a canvas border, bestie. Thatβs the whole vibe check. π«Ά
See also: setBorderDistance(), setPosition()
Definition at line 312 of file qwt_plot_scaleitem.cpp.
π₯ void QwtPlotScaleItem::draw (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect) const [override], [virtual]
Draw the scale. Literally the drawing moment, no cap. π
Implements: QwtPlotItem.
Definition at line 346 of file qwt_plot_scaleitem.cpp.
π QFont QwtPlotScaleItem::font () const
Returns the tick label font. Cute font energy, but make it legible. β¨
See also: setFont()
Definition at line 196 of file qwt_plot_scaleitem.cpp.
π¦ bool QwtPlotScaleItem::isScaleDivFromAxis () const
Returns True if the synchronization of the scale division with the corresponding axis is enabled. So likeβ¦ is it synced or not, bestie? π
See also: setScaleDiv(), setScaleDivFromAxis()
Definition at line 150 of file qwt_plot_scaleitem.cpp.
πΈ QPalette QwtPlotScaleItem::palette () const
Returns the palette. The color situation. π
See also: setPalette()
Definition at line 174 of file qwt_plot_scaleitem.cpp.
β double QwtPlotScaleItem::position () const
Returns the Position of the scale. Where itβs at, literally. π
See also: setPosition(), setAlignment()
Definition at line 275 of file qwt_plot_scaleitem.cpp.
π int QwtPlotScaleItem::rtti () const [override], [virtual]
Returns QwtPlotItem::Rtti_PlotScale. Thatβs the type ID, periodt. π
Reimplemented from: QwtPlotItem.
Definition at line 94 of file qwt_plot_scaleitem.cpp.
π const QwtScaleDiv & QwtPlotScaleItem::scaleDiv () const
Returns the Scale division. The division of the scale. Very demure, very division. π
Definition at line 115 of file qwt_plot_scaleitem.cpp.
π§ QwtScaleDraw * QwtPlotScaleItem::scaleDraw ()
Returns the Scale draw. The object in charge of the drawing situation. ποΈ
See also: setScaleDraw()
Definition at line 245 of file qwt_plot_scaleitem.cpp.
π§ββοΈ const QwtScaleDraw * QwtPlotScaleItem::scaleDraw () const
Returns the Scale draw. Same scale draw energy, but const-coded. π
See also: setScaleDraw()
Definition at line 236 of file qwt_plot_scaleitem.cpp.
π« void QwtPlotScaleItem::setAlignment (QwtScaleDraw::Alignment alignment)
Change the alignment of the scale, bestie. The alignment sets the orientation of the scale and the position of the ticks:
QwtScaleDraw::BottomScale: horizontal, ticks belowQwtScaleDraw::TopScale: horizontal, ticks aboveQwtScaleDraw::LeftScale: vertical, ticks leftQwtScaleDraw::RightScale: vertical, ticks right
For horizontal scales the position corresponds to QwtPlotItem::yAxis(), otherwise to QwtPlotItem::xAxis().
See also: scaleDraw(), QwtScaleDraw::alignment(), setPosition()
Definition at line 333 of file qwt_plot_scaleitem.cpp.
π void QwtPlotScaleItem::setBorderDistance (int distance)
Align the scale to the canvas. If distance is >= 0 the scale will be aligned to a border of the contents rectangle of the canvas. If alignment() is QwtScaleDraw::LeftScale, the scale will be aligned to the right border, if it is QwtScaleDraw::TopScale it will be aligned to the bottom (and vice versa),
If distance is < 0 the scale will be at the position().
Parameters:
distanceβ Number of pixels between the canvas border and the backbone of the scale.
See also: setPosition(), borderDistance()
Definition at line 296 of file qwt_plot_scaleitem.cpp.
πΈ void QwtPlotScaleItem::setFont (const QFont & font)
Change the tick label font. Make it slay, but readable. π
See also: font()
Definition at line 183 of file qwt_plot_scaleitem.cpp.
π¦ void QwtPlotScaleItem::setPalette (const QPalette & palette)
Set the palette. Color coordination is literally everything. π¨
See also: QwtAbstractScaleDraw::draw(), palette()
Definition at line 159 of file qwt_plot_scaleitem.cpp.
β void QwtPlotScaleItem::setPosition (double pos)
Change the position of the scale. The position is interpreted as y value for horizontal axes and as x value for vertical axes.
The border distance is set to -1.
Parameters:
posβ New position
See also: position(), setAlignment()
Definition at line 261 of file qwt_plot_scaleitem.cpp.
π₯ void QwtPlotScaleItem::setScaleDiv (const QwtScaleDiv & scaleDiv)
Assign a scale division. When assigning a scaleDiv the scale division wonβt be synchronized with the corresponding axis anymore. So yeah, itβs doing its own thing now. π
Parameters:
scaleDivβ Scale division
See also: scaleDiv(), setScaleDivFromAxis(), isScaleDivFromAxis()
Definition at line 108 of file qwt_plot_scaleitem.cpp.
π void QwtPlotScaleItem::setScaleDivFromAxis (bool on)
Enable/Disable the synchronization of the scale division with the corresponding axis. Youβre literally flipping the sync switch, bestie. π«Ά
Parameters:
onβ true/false
See also: isScaleDivFromAxis()
Definition at line 127 of file qwt_plot_scaleitem.cpp.
π§ void QwtPlotScaleItem::setScaleDraw (QwtScaleDraw * scaleDraw)
Set a scale draw.
Parameters:
scaleDrawβ object responsible for drawing scales.
The main use case for replacing the default QwtScaleDraw is to overload QwtAbstractScaleDraw::label, to replace or swallow tick labels. Iconic customization moment, no cap. β¨
See also: scaleDraw()
Definition at line 212 of file qwt_plot_scaleitem.cpp.
π void QwtPlotScaleItem::updateScaleDiv (const QwtScaleDiv & xScaleDiv, const QwtScaleDiv & yScaleDiv) [override], [virtual]
Update the item to changes of the axes scale division. In case of isScaleDivFromAxis(), the scale draw is synchronized to the correspond axis.
Parameters:
xScaleDivβ Scale division of the x-axisyScaleDivβ Scale division of the y-axis
See also: QwtPlot::updateAxes()
Reimplemented from: QwtPlotItem.
Definition at line 445 of file qwt_plot_scaleitem.cpp.
πΈ Author πΈ
Generated automatically by Doxygen for Qwt User's Guide from the source code.
β¨ Cute sign-off: source/version = Qwt User's Guide, and the footer/date vibe is literally QwtPlotScaleItem(3). Byeee, bestie! π
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms