QwtPlotLayout(3)

πŸ’… QwtPlotLayout(3) β€” the layout engine that makes your plot look good

Okay bestie, gather round, because this is the manual page for QwtPlotLayout(3) from the Library Functions Manual, and it's literally the glow-up artist for your QwtPlot. Think of it as the main character who organizes all the internal widgets so your plot doesn't look a mess. No cap.


✨ NAME ✨

QwtPlotLayout β€” Layout engine for QwtPlot. That's it. That's the vibe. It handles the layout. Periodt.


🌸 SYNOPSIS 🌸

#include <qwt_plot_layout.h>

πŸŽ€ Public Types

  • enum Option β€” { AlignScales = 0x01, IgnoreScrollbars = 0x02, IgnoreFrames = 0x04, IgnoreLegend = 0x08, IgnoreTitle = 0x10, IgnoreFooter = 0x20 }
  • typedef QFlags< Option > Options β€” because sometimes you need to OR a bunch of these together, iykyk.

πŸ¦‹ Public Member Functions

  • QwtPlotLayout () β€” Constructor. The birth of a legend.
  • virtual ~QwtPlotLayout () β€” Destructor. It's giving closure.
  • void setCanvasMargin (int margin, int axis=-1)
  • int canvasMargin (int axisId) const
  • void setAlignCanvasToScales (bool) β€” Set the align-canvas-to-axis-scales flag for all axes. Slay.
  • void setAlignCanvasToScale (int axisId, bool)
  • bool alignCanvasToScale (int axisId) const
  • void setSpacing (int)
  • int spacing () const
  • void setLegendPosition (QwtPlot::LegendPosition pos, double ratio) β€” Specify the position of the legend. Iconic.
  • void setLegendPosition (QwtPlot::LegendPosition pos) β€” Same thing, different overload. We love options.
  • QwtPlot::LegendPosition legendPosition () const
  • void setLegendRatio (double ratio)
  • double legendRatio () const
  • virtual QSize minimumSizeHint (const QwtPlot *) const
  • virtual void activate (const QwtPlot *, const QRectF &plotRect, Options options=Options()) β€” Recalculate the geometry of all components. The moment of truth.
  • virtual void invalidate ()
  • QRectF titleRect () const
  • QRectF footerRect () const
  • QRectF legendRect () const
  • QRectF scaleRect (QwtAxisId) const
  • QRectF canvasRect () const

πŸ’œ Protected Member Functions

  • void setTitleRect (const QRectF &) β€” Set the geometry for the title.
  • void setFooterRect (const QRectF &) β€” Set the geometry for the footer.
  • void setLegendRect (const QRectF &) β€” Set the geometry for the legend.
  • void setScaleRect (QwtAxisId, const QRectF &) β€” Set the geometry for an axis.
  • void setCanvasRect (const QRectF &) β€” Set the geometry for the canvas.

🌈 DETAILED DESCRIPTION 🌈

So what is this thing? QwtPlotLayout is the layout engine for QwtPlot. It's used by the QwtPlot widget to organize its internal widgets, or by QwtPlot::print() to render its content to a QPaintDevice like a QPrinter, QPixmap/QImage, or QSvgRenderer. Basically it makes sure everything is where it should be. Highkey essential.

See also: QwtPlot::setPlotLayout()

Definition at line 27 of file qwt_plot_layout.h. (Yes, we cite our sources. Academic queen.)


🧚 MEMBER TYPEDEF DOCUMENTATION 🧚

typedef QFlags<Option > QwtPlotLayout::Options

An ORed combination of Option values. Like mixing and matching vibes. You can combine them, bestie.

Definition at line 58 of file qwt_plot_layout.h.


πŸ‘‘ MEMBER ENUMERATION DOCUMENTATION πŸ‘‘

enum QwtPlotLayout::Option

These are the options to configure the plot layout engine. Each one is a little switch that changes how the layout behaves.

See also: activate(), QwtPlotRenderer

The Enumerators (a.k.a. the cast of characters)

  • AlignScales β€” Unused. Yep. It's literally just sitting there. Not doing anything. But it's in the enum, so we respect its presence. πŸ™ˆ
  • IgnoreScrollbars β€” Ignore the dimension of the scrollbars. There are no scrollbars when the plot is not rendered to widgets. So like, when you're printing or whatever, scrollbars aren't a thing.
  • IgnoreFrames β€” Ignore all frames. No frames. Zero. None.
  • IgnoreLegend β€” Ignore the legend. Sorry legend, you're not invited to this party.
  • IgnoreTitle β€” Ignore the title. Title? Never heard of her.
  • IgnoreFooter β€” Ignore the footer. Bye footer.

Definition at line 34 of file qwt_plot_layout.h.


🌟 CONSTRUCTOR & DESTRUCTOR DOCUMENTATION 🌟

QwtPlotLayout::QwtPlotLayout () [explicit]

Constructor. It constructs. It's the beginning. The origin story. Every layout engine starts somewhere, and this is it.

Definition at line 1036 of file qwt_plot_layout.cpp.

QwtPlotLayout::~QwtPlotLayout () [virtual]

Destructor. It destructs. The end of an era. Virtual, so it plays nice with inheritance. Classy.

Definition at line 1048 of file qwt_plot_layout.cpp.


And that's part 1, bestie! We're not done yet β€” there's more where this came from. Stay tuned. πŸ’–

πŸ’– MEMBER FUNCTION DOCUMENTATION πŸ’–

void QwtPlotLayout::activate (const QwtPlot * plot, const QRectF & plotRect, Options options = Options()) [virtual]

Okay bestie, this one’s the main character: it recalculates the geometry of all components. Literally the whole layout glow-up.

  • Parameters:
    • plot β€” Plot to be layout
    • plotRect β€” Rectangle where to place the components
    • options β€” Layout options
  • See also: invalidate(), titleRect(), footerRect(), legendRect(), scaleRect(), canvasRect()

Definition at line 1508 of file qwt_plot_layout.cpp.


bool QwtPlotLayout::alignCanvasToScale (int axisPos) const

Returns the align-canvas-to-axis-scales setting, no cap. The canvas may:

  • extend beyond the axis scale ends to maximize its size
  • align with the axis scale ends to control its size.
  • Parameters:
    • axisPos β€” Axis position
  • Returns: align-canvas-to-axis-scales setting
  • See also: setAlignCanvasToScale(), setAlignCanvasToScale(), setCanvasMargin() 🫢

Definition at line 1141 of file qwt_plot_layout.cpp.


int QwtPlotLayout::canvasMargin (int axisPos) const

  • Parameters:
    • axisPos β€” Axis position
  • Returns: Margin around the scale tick borders
  • See also: setCanvasMargin()

Definition at line 1089 of file qwt_plot_layout.cpp.


QRectF QwtPlotLayout::canvasRect () const

  • Returns: Geometry for the canvas
  • See also: activate(), invalidate()

Definition at line 1380 of file qwt_plot_layout.cpp.


QRectF QwtPlotLayout::footerRect () const

  • Returns: Geometry for the footer
  • See also: activate(), invalidate()

Definition at line 1304 of file qwt_plot_layout.cpp.


void QwtPlotLayout::invalidate () [virtual]

Invalidates the geometry of all components. It’s giving β€œlayout memory reset” energy.

  • See also: activate()

Definition at line 1389 of file qwt_plot_layout.cpp.


QwtPlot::LegendPosition QwtPlotLayout::legendPosition () const

  • Returns: Position of the legend
  • See also: setLegendPosition(), QwtPlot::setLegendPosition(), QwtPlot::legendPosition()

Definition at line 1237 of file qwt_plot_layout.cpp.


double QwtPlotLayout::legendRatio () const

  • Returns: The relative size of the legend in the plot.
  • See also: setLegendPosition()

Definition at line 1260 of file qwt_plot_layout.cpp.


QRectF QwtPlotLayout::legendRect () const

  • Returns: Geometry for the legend
  • See also: activate(), invalidate()

Definition at line 1328 of file qwt_plot_layout.cpp.


QSize QwtPlotLayout::minimumSizeHint (const QwtPlot * plot) const [virtual]

Returns the minimum size hint, aka the β€œsmallest this can go before it starts acting up” vibe.

  • Parameters:
    • plot β€” Plot widget
  • Returns: Minimum size hint
  • See also: QwtPlot::minimumSizeHint()

Definition at line 1404 of file qwt_plot_layout.cpp.


QRectF QwtPlotLayout::scaleRect (QwtAxisId axisId) const

  • Parameters:
    • axisId β€” Axis
  • Returns: Geometry for the scale
  • See also: activate(), invalidate()

Definition at line 1355 of file qwt_plot_layout.cpp.


void QwtPlotLayout::setAlignCanvasToScale (int axisPos, bool on)

Changes the align-canvas-to-axis-scales setting. The canvas may:

  • extend beyond the axis scale ends to maximize its size,
  • align with the axis scale ends to control its size.

Heads up, bestie: the axisId parameter is somehow confusing as it identifies a border of the plot and not the axes, that are aligned. F.e when QwtAxis::YLeft is set, the left end of the the x-axes ( QwtAxis::XTop, QwtAxis::XBottom ) is aligned.

  • Parameters:
    • axisPos β€” Axis position
    • on β€” New align-canvas-to-axis-scales setting
  • See also: setCanvasMargin(), alignCanvasToScale(), setAlignCanvasToScales()
⚠️ Warning: In case of on == true canvasMargin() will have no effect.

Definition at line 1126 of file qwt_plot_layout.cpp.


void QwtPlotLayout::setAlignCanvasToScales (bool on)

Sets the align-canvas-to-axis-scales flag for all axes. One switch, every axis, slay.

  • Parameters:
    • on β€” True/False
  • See also: setAlignCanvasToScale(), alignCanvasToScale()

Definition at line 1103 of file qwt_plot_layout.cpp.


void QwtPlotLayout::setCanvasMargin (int margin, int axisPos = -1)

Changes a margin of the canvas. The margin is the space above/below the scale ticks. A negative margin will be set to -1, excluding the borders of the scales.

  • Parameters:
    • margin β€” New margin
    • axisPos β€” One of QwtAxis::Position. Specifies where the position of the margin. -1 means margin at all borders.
  • See also: canvasMargin()
⚠️ Warning: The margin will have no effect when alignCanvasToScale() is true.

Definition at line 1066 of file qwt_plot_layout.cpp.


void QwtPlotLayout::setCanvasRect (const QRectF & rect) [protected]

Sets the geometry for the canvas. This method is intended to be used from derived layouts overloading activate().

  • See also: canvasRect(), activate()

Definition at line 1371 of file qwt_plot_layout.cpp.


void QwtPlotLayout::setFooterRect (const QRectF & rect) [protected]

Sets the geometry for the footer. This method is intended to be used from derived layouts overloading activate().

  • See also: footerRect(), activate()

Definition at line 1295 of file qwt_plot_layout.cpp.


void QwtPlotLayout::setLegendPosition (QwtPlot::LegendPosition pos)

Specifies the position of the legend.

  • Parameters:
    • pos β€” The legend’s position. Valid values are QwtPlot::LeftLegend, QwtPlot::RightLegend, QwtPlot::TopLegend, QwtPlot::BottomLegend.
  • See also: QwtPlot::setLegendPosition()

Definition at line 1227 of file qwt_plot_layout.cpp.


void QwtPlotLayout::setLegendPosition (QwtPlot::LegendPosition pos, double ratio)

Specifies the position of the legend, now with ratio flavor.

  • Parameters:
    • pos β€” The legend’s position.
    • ratio β€” Ratio between legend and the bounding rectangle of title, footer, canvas and axes. The legend will be shrunk 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.
  • See also: QwtPlot::setLegendPosition()

Definition at line 1183 of file qwt_plot_layout.cpp.


void QwtPlotLayout::setLegendRatio (double ratio)

Specifies the relative size of the legend in the plot.

  • Parameters:
    • ratio β€” Ratio between legend and the bounding rectangle of title, footer, canvas and axes. The legend will be shrunk 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.

Definition at line 1251 of file qwt_plot_layout.cpp.


void QwtPlotLayout::setLegendRect (const QRectF & rect) [protected]

Sets the geometry for the legend. This method is intended to be used from derived layouts overloading activate().

  • Parameters:
    • rect β€” Rectangle for the legend
  • See also: legendRect(), activate()

Definition at line 1319 of file qwt_plot_layout.cpp.


void QwtPlotLayout::setScaleRect (QwtAxisId axisId, const QRectF & rect) [protected]

Sets the geometry for an axis. This method is intended to be used from derived layouts overloading activate().

  • Parameters:
    • axisId β€” Axis
    • rect β€” Rectangle for the scale
  • See also: scaleRect(), activate()

Definition at line 1344 of file qwt_plot_layout.cpp.


void QwtPlotLayout::setSpacing (int spacing)

Changes the spacing of the plot. The spacing is the distance between the plot components.

  • Parameters:
    • spacing β€” New spacing
  • See also: setCanvasMargin(), spacing()

Definition at line 1156 of file qwt_plot_layout.cpp.


void QwtPlotLayout::setTitleRect (const QRectF & rect) [protected]

Sets the geometry for the title. This method is intended to be used from derived layouts overloading activate().

  • See also: titleRect(), activate()

Definition at line 1273 of file qwt_plot_layout.cpp.


int QwtPlotLayout::spacing () const

  • Returns: Spacing
  • See also: margin(), setSpacing()

Definition at line 1165 of file qwt_plot_layout.cpp.


QRectF QwtPlotLayout::titleRect () const

  • Returns: Geometry for the title
  • See also: activate(), invalidate()

Definition at line 1282 of file qwt_plot_layout.cpp.


πŸŽ€ AUTHOR πŸŽ€

Generated automatically by Doxygen for Qwt User’s Guide from the source code. 🫢

Byeee bestie β€” this was the Qwt User's Guide, page QwtPlotLayout(3), with the build’s footer date doing its little cameo at the end instead of getting copy-pasted. Mwah πŸ’…βœ¨

πŸ“¦ where this page comes from