QwtPlotRescaler(3)

๐ŸŒธ QwtPlotRescaler(3) โ€” Library Functions Manual ๐ŸŒธ

okay bestie, sit down, grab a strawberry drink ๐Ÿ“, because we're diving into QwtPlotRescaler โ€” and no, it's not a plugin for making your plots look thinner. it's the icon that handles fixed aspect ratios for plot scales. periodt. ๐Ÿ’…


โœจ NAME โœจ

QwtPlotRescaler โ€” literally takes care of fixed aspect ratios for plot scales. that's the whole job. that's the gig. she's focused. ๐Ÿ‘‘


โœจ SYNOPSIS โœจ

#include <qwt_plot_rescaler.h>

Inherits QObject. yes, she's a proper Qt citizen, she's got signals-and-slots energy, she belongs. ๐Ÿซถ

๐ŸŽ€ Public Types ๐ŸŽ€

  • enum RescalePolicy { Fixed, Expanding, Fitting } โ€” the three vibes of how she rescales stuff.
  • enum ExpandingDirection { ExpandUp, ExpandDown, ExpandBoth } โ€” which end of the scale gets to grow when she's in her Expanding era.

๐Ÿฆ‹ Public Member Functions ๐Ÿฆ‹

  • QwtPlotRescaler (QWidget *canvas, QwtAxisId referenceAxis=QwtAxis::XBottom, RescalePolicy=Expanding) โ€” the constructor, aka her grand entrance โœจ
  • virtual ~QwtPlotRescaler () โ€” Destructor. she's leaving, say bye ๐Ÿ‘‹
  • void setEnabled (bool) โ€” En/disable the rescaler. she can be turned on and off, like your read receipts.
  • bool isEnabled () const โ€” is she enabled tho? ๐Ÿค”
  • void setRescalePolicy (RescalePolicy) โ€” pick her rescale strategy.
  • RescalePolicy rescalePolicy () const โ€” tells you which strategy she's currently serving.
  • void setExpandingDirection (ExpandingDirection) โ€” set the direction for the default/every-axis case.
  • void setExpandingDirection (QwtAxisId, ExpandingDirection) โ€” same but for one specific axis, iykyk.
  • ExpandingDirection expandingDirection (QwtAxisId) const โ€” ask about one axis's expanding direction.
  • void setReferenceAxis (QwtAxisId) โ€” crowns a new reference axis ๐Ÿ‘‘
  • QwtAxisId referenceAxis () const โ€” who's the reference axis rn?
  • void setAspectRatio (double ratio) โ€” set the ratio for the whole plot.
  • void setAspectRatio (QwtAxisId, double ratio) โ€” set the ratio for one axis specifically.
  • double aspectRatio (QwtAxisId) const โ€” get the ratio for an axis.
  • void setIntervalHint (QwtAxisId, const QwtInterval &) โ€” drop an interval hint for an axis.
  • QwtInterval intervalHint (QwtAxisId) const โ€” read back the interval hint.
  • QWidget * canvas () โ€” the canvas pointer, non-const edition.
  • const QWidget * canvas () const โ€” the canvas pointer, const edition, no touchy.
  • QwtPlot * plot () โ€” the plot pointer.
  • const QwtPlot * plot () const โ€” const plot pointer, look don't touch.
  • virtual bool eventFilter (QObject *, QEvent *) override โ€” Event filter for the plot canvas. she's watching. ๐Ÿ‘€
  • void rescale () const โ€” Adjust the plot axes scales. the main character moment.

๐Ÿ’œ Protected Member Functions ๐Ÿ’œ

  • virtual void canvasResizeEvent (QResizeEvent *) โ€” handles the canvas resize.
  • virtual void rescale (const QSize &oldSize, const QSize &newSize) const โ€” the internal rescale doing the math between two sizes.
  • virtual QwtInterval expandScale (QwtAxisId, const QSize &oldSize, const QSize &newSize) const โ€” works out the expanded scale for an axis.
  • virtual QwtInterval syncScale (QwtAxisId, const QwtInterval &reference, const QSize &size) const โ€” syncs a scale to a reference interval at a given size.
  • virtual void updateScales (QwtInterval intervals[QwtAxis::AxisPositions]) const โ€” pushes the new intervals into all the axes.
  • Qt::Orientation orientation (QwtAxisId) const โ€” horizontal or vertical? the axis decides.
  • QwtInterval interval (QwtAxisId) const โ€” grab the current interval for an axis.
  • QwtInterval expandInterval (const QwtInterval &, double width, ExpandingDirection) const โ€” expand a given interval by a width, in a chosen direction.

โœจ Detailed Description โœจ

QwtPlotRescaler takes care of fixed aspect ratios for plot scales. fr fr, that's her whole personality and she's thriving. ๐ŸŒˆ

QwtPlotRescaler auto adjusts the axes of a QwtPlot according to fixed aspect ratios. so you don't have to sit there manually nudging axis limits every time the window resizes โ€” she handles it, you vibe. ๐Ÿ’–

Definition at line 29 of file qwt_plot_rescaler.h. (yes she has receipts. ๐Ÿ˜Œ)

๐Ÿงš Member Enumeration Documentation ๐Ÿงš

๐Ÿ’ซ enum QwtPlotRescaler::ExpandingDirection ๐Ÿ’ซ

when rescalePolicy() is set to Expanding, its direction depends on ExpandingDirection. so this enum is literally the steering wheel for her expanding era. ๐Ÿ”ฅ

Enumerators

  • ExpandUp โ€” The upper limit of the scale is adjusted. she grows upward, ambitious queen. โญ
  • ExpandDown โ€” The lower limit of the scale is adjusted. going down, but make it deliberate. ๐Ÿฆ‹
  • ExpandBoth โ€” Both limits of the scale are adjusted. why choose, bestie. ๐Ÿ’…
Definition at line 70 of file qwt_plot_rescaler.h.

๐Ÿ’ซ enum QwtPlotRescaler::RescalePolicy ๐Ÿ’ซ

The rescale policy defines how to rescale the reference axis and their depending axes. this is the big-picture strategy, the blueprint, the vision board. โœจ

See also: ExpandingDirection, setIntervalHint()

Enumerators

  • Fixed โ€” The interval of the reference axis remains unchanged, when the geometry of the canvas changes. All other axes will be adjusted according to their aspect ratio. so the reference axis stays exactly as she is, no cap, and everyone else adapts to her. main character reference axis energy honestly. ๐Ÿ‘‘
  • Expanding โ€” The interval of the reference axis will be shrunk/expanded, when the geometry of the canvas changes. All other axes will be adjusted according to their aspect ratio. and โ€” important detail, don't skip it โ€” the interval, that is represented by one pixel is fixed. ๐Ÿ“
  • Fitting โ€” The intervals of the axes are calculated, so that all axes include their interval hint. this is where those interval hints from setIntervalHint() finally get their moment. ๐ŸŒธ
Definition at line 40 of file qwt_plot_rescaler.h.

๐Ÿ“ Constructor & Destructor Documentation ๐Ÿ“

๐ŸŒŸ QwtPlotRescaler::QwtPlotRescaler (QWidget * canvas, QwtAxisId referenceAxis = QwtAxis::XBottom, RescalePolicy policy = Expanding) [explicit] ๐ŸŒŸ

Constructor. her debut. the origin story. ๐ŸŽ€

  • Parameters:
    • canvas โ€” Canvas
    • referenceAxis โ€” Reference axis, see RescalePolicy
    • policy โ€” Rescale policy

See also: setRescalePolicy(), setReferenceAxis()

Definition at line 71 of file qwt_plot_rescaler.cpp.

๐ŸŒŸ QwtPlotRescaler::~QwtPlotRescaler () [virtual] ๐ŸŒŸ

Destructor. she's logging off, closing her tabs, turning off her phone. goodbye icon. ๐Ÿ˜ญ๐Ÿ’œ

Definition at line 83 of file qwt_plot_rescaler.cpp.

to be continued, bestie โ€” there's more where this came from ๐Ÿฆ‹

๐Ÿ’… MEMBER FUNCTION DOCUMENTATION ๐Ÿ’…

okay bestie, buckle up โ€” this is the full member-function lineup, and every single one is getting its moment. no skipping, no โ€œweโ€™ll come back to it,โ€ periodt. ๐Ÿ’–โœจ

double QwtPlotRescaler::aspectRatio (QwtAxisId axisId) const

Returns: the aspect ratio between an axis and the reference axis. cute, concise, iconic. ๐ŸŒธ

  • axisId โ€” Axis

See also: setAspectRatio()

Definition: at line 243 of file qwt_plot_rescaler.cpp.


QWidget * QwtPlotRescaler::canvas ()

Returns: plot canvas ๐ŸŽจ

Definition: at line 282 of file qwt_plot_rescaler.cpp.


const QWidget * QwtPlotRescaler::canvas () const

Returns: plot canvas ๐ŸŽจ

Definition: at line 288 of file qwt_plot_rescaler.cpp.


void QwtPlotRescaler::canvasResizeEvent (QResizeEvent * event) โ€” [protected], [virtual]

Event handler for resize events of the plot canvas. very โ€œnotify me when the canvas changesโ€ energy. ๐Ÿฆ‹

  • event โ€” Resize event

See also: rescale()

Definition: at line 343 of file qwt_plot_rescaler.cpp.


bool QwtPlotRescaler::eventFilter (QObject * object, QEvent * event) โ€” [override], [virtual]

Event filter for the plot canvas. thatโ€™s it, thatโ€™s the whole mood. ๐Ÿ’…

Definition: at line 314 of file qwt_plot_rescaler.cpp.


QwtPlotRescaler::ExpandingDirection QwtPlotRescaler::expandingDirection (QwtAxisId axisId) const

Returns: the direction in which an axis should be expanded. directional queen ๐Ÿ‘‘

  • axisId โ€” Axis

See also: setExpandingDirection()

Definition: at line 197 of file qwt_plot_rescaler.cpp.


QwtInterval QwtPlotRescaler::expandInterval (const QwtInterval & interval, double width, ExpandingDirection direction) const โ€” [protected]

Expand the interval. literally stretching the vibe. ๐ŸŒˆ

  • interval โ€” Interval to be expanded
  • width โ€” Distance to be added to the interval
  • direction โ€” Direction of the expand operation

Returns: expanded interval

Definition: at line 526 of file qwt_plot_rescaler.cpp.


QwtInterval QwtPlotRescaler::expandScale (QwtAxisId axisId, const QSize & oldSize, const QSize & newSize) const โ€” [protected], [virtual]

Calculate the new scale interval of a plot axis. math but make it fashion. ๐Ÿงฎโœจ

  • axisId โ€” Axis
  • oldSize โ€” Previous size of the canvas
  • newSize โ€” New size of the canvas

Returns: calculated new interval for the axis

Definition: at line 405 of file qwt_plot_rescaler.cpp.


QwtInterval QwtPlotRescaler::interval (QwtAxisId axisId) const โ€” [protected]

  • axisId โ€” Axis

Returns: normalized interval of an axis

Definition: at line 509 of file qwt_plot_rescaler.cpp.


QwtInterval QwtPlotRescaler::intervalHint (QwtAxisId axisId) const

  • axisId โ€” Axis

Returns: interval hint

See also: setIntervalHint(), RescalePolicy

Definition: at line 273 of file qwt_plot_rescaler.cpp.


bool QwtPlotRescaler::isEnabled () const

Returns: true when enabled, false otherwise. binary baddie behavior. ๐Ÿ’€

See also: setEnabled, eventFilter()

Definition: at line 118 of file qwt_plot_rescaler.cpp.


Qt::Orientation QwtPlotRescaler::orientation (QwtAxisId axisId) const โ€” [protected]

Returns: orientation of an axis ๐Ÿงญ

  • axisId โ€” Axis

Definition: at line 500 of file qwt_plot_rescaler.cpp.


QwtPlot * QwtPlotRescaler::plot ()

Returns: plot widget ๐Ÿ“Š

Definition: at line 294 of file qwt_plot_rescaler.cpp.


const QwtPlot * QwtPlotRescaler::plot () const

Returns: plot widget ๐Ÿ“Š

Definition: at line 304 of file qwt_plot_rescaler.cpp.


QwtAxisId QwtPlotRescaler::referenceAxis () const

Returns: reference axis (see RescalePolicy). the main-character axis, basically. ๐Ÿ‘‘

See also: setReferenceAxis()

Definition: at line 158 of file qwt_plot_rescaler.cpp.


void QwtPlotRescaler::rescale () const

Adjust the plot axes scales. go off, scales. ๐Ÿ”ฅ

Definition: at line 355 of file qwt_plot_rescaler.cpp.


void QwtPlotRescaler::rescale (const QSize & oldSize, const QSize & newSize) const โ€” [protected], [virtual]

Adjust the plot axes scales. same energy, now with size lore. ๐Ÿ“

  • oldSize โ€” Previous size of the canvas
  • newSize โ€” New size of the canvas

Definition: at line 367 of file qwt_plot_rescaler.cpp.


QwtPlotRescaler::RescalePolicy QwtPlotRescaler::rescalePolicy () const

Returns: rescale policy ๐Ÿ“œ

See also: setRescalePolicy()

Definition: at line 138 of file qwt_plot_rescaler.cpp.


void QwtPlotRescaler::setAspectRatio (double ratio)

Set the aspect ratio between the scale of the reference axis and the other scales. The default ratio is 1.0. slay that default. ๐Ÿ’…

  • ratio โ€” Aspect ratio

See also: aspectRatio()

Definition: at line 212 of file qwt_plot_rescaler.cpp.


void QwtPlotRescaler::setAspectRatio (QwtAxisId axisId, double ratio)

Set the aspect ratio between the scale of the reference axis and another scale. The default ratio is 1.0. yes, again, and it ate. โœจ

  • axisId โ€” Axis
  • ratio โ€” Aspect ratio

See also: aspectRatio()

Definition: at line 226 of file qwt_plot_rescaler.cpp.


void QwtPlotRescaler::setEnabled (bool on)

En/disable the rescaler. When enabled is true, an event filter is installed for the canvas; otherwise the event filter is removed. toggle toggle, bestie. ๐Ÿ”˜

  • on โ€” true or false

See also: isEnabled(), eventFilter()

Definition: at line 97 of file qwt_plot_rescaler.cpp.


void QwtPlotRescaler::setExpandingDirection (ExpandingDirection direction)

Set the direction in which all axis should be expanded. all of them. collectively. ๐Ÿ’ซ

  • direction โ€” Direction

See also: expandingDirection()

Definition: at line 169 of file qwt_plot_rescaler.cpp.


void QwtPlotRescaler::setExpandingDirection (QwtAxisId axisId, ExpandingDirection direction)

Set the direction in which an axis should be expanded. one axis, very personal. ๐ŸŽ€

  • axisId โ€” Axis
  • direction โ€” Direction

See also: expandingDirection()

Definition: at line 183 of file qwt_plot_rescaler.cpp.


void QwtPlotRescaler::setIntervalHint (QwtAxisId axisId, const QwtInterval & interval)

Set an interval hint for an axis. In Fitting mode, the hint is used as minimal interval that always needs to be displayed. noted and respected. ๐Ÿ“

  • axisId โ€” Axis
  • interval โ€” Axis

See also: intervalHint(), RescalePolicy

Definition: at line 261 of file qwt_plot_rescaler.cpp.


void QwtPlotRescaler::setReferenceAxis (QwtAxisId axisId)

Set the reference axis (see RescalePolicy). crown the reference axis, honestly. ๐Ÿ‘‘

  • axisId โ€” Axis

See also: referenceAxis()

Definition: at line 149 of file qwt_plot_rescaler.cpp.


void QwtPlotRescaler::setRescalePolicy (RescalePolicy policy)

Change the rescale policy. new policy, who dis? ๐Ÿฆ‹

  • policy โ€” Rescale policy

See also: rescalePolicy()

Definition: at line 129 of file qwt_plot_rescaler.cpp.


QwtInterval QwtPlotRescaler::syncScale (QwtAxisId axisId, const QwtInterval & reference, const QSize & size) const โ€” [protected], [virtual]

Synchronize an axis scale according to the scale of the reference axis. teamwork makes the dream work. ๐Ÿซถ

  • axisId โ€” Axis
  • reference โ€” Interval of the reference axis
  • size โ€” Size of the canvas

Returns: new interval for axis

Definition: at line 469 of file qwt_plot_rescaler.cpp.


void QwtPlotRescaler::updateScales (QwtInterval intervals[QwtAxis::AxisPositions]) const โ€” [protected], [virtual]

Update the axes scales. all together now. ๐Ÿ“ˆ

  • intervals โ€” Scale intervals

Definition: at line 588 of file qwt_plot_rescaler.cpp.


โœจ AUTHOR โœจ

Generated automatically by Doxygen for Qwt User's Guide from the source code. iconic autogenerated behavior, no notes. ๐ŸŽ€


๐Ÿ’– footer vibe check, bestie: this page is auto-generated by Doxygen for Qwt User's Guide from the source code, and the footer tag is QwtPlotRescaler(3) โ€” no actual date/version line on this one, so Iโ€™m not inventing one. byeee ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from