QwtPlotRenderer(3)

πŸ’… QwtPlotRenderer(3) β€” the library-functions manual, but make it cute

okay so bestie. this one's a Library Functions Manual page for QwtPlotRenderer(3), and it's basically the glow-up artist for your plots ✨ It's the renderer that takes a plot and exports it to a document, a printer, or literally anything else that QPainter/QPaintDevice can handle. Iconic behavior, honestly.


🌸 NAME 🌸

QwtPlotRenderer β€” Renderer for exporting a plot to a document, a printer or anything else, that is supported by QPainter/QPaintDevice. πŸ’–


✨ SYNOPSIS ✨

#include <qwt_plot_renderer.h>

Inherits QObject. 🫢

πŸŽ€ Public Types πŸŽ€

  • enum DiscardFlag β€” { DiscardNone = 0x00, DiscardBackground = 0x01, DiscardTitle = 0x02, DiscardLegend = 0x04, DiscardCanvasBackground = 0x08, DiscardFooter = 0x10, DiscardCanvasFrame = 0x20 } β€” these are the Discard flags πŸ’…
  • enum LayoutFlag β€” { DefaultLayout = 0x00, FrameWithScales = 0x01 } β€” these are the Layout flags πŸ¦‹
  • typedef QFlags< DiscardFlag > DiscardFlags
  • typedef QFlags< LayoutFlag > LayoutFlags

πŸ’œ Public Member Functions πŸ’œ

  • QwtPlotRenderer (QObject *=NULL)
  • virtual ~QwtPlotRenderer () β€” Destructor πŸ’€
  • void setDiscardFlag (DiscardFlag flag, bool on=true)
  • bool testDiscardFlag (DiscardFlag flag) const
  • void setDiscardFlags (DiscardFlags flags)
  • DiscardFlags discardFlags () const
  • void setLayoutFlag (LayoutFlag flag, bool on=true)
  • bool testLayoutFlag (LayoutFlag flag) const
  • void setLayoutFlags (LayoutFlags flags)
  • LayoutFlags layoutFlags () const
  • void renderDocument (QwtPlot *, const QString &fileName, const QSizeF &sizeMM, int resolution=85)
  • void renderDocument (QwtPlot *, const QString &fileName, const QString &format, const QSizeF &sizeMM, int resolution=85)
  • void renderTo (QwtPlot *, QPrinter &) const β€” Render the plot to a QPrinter πŸ–¨οΈ
  • void renderTo (QwtPlot *, QPaintDevice &) const β€” Render the plot to a QPaintDevice 🎨
  • virtual void render (QwtPlot *, QPainter *, const QRectF &plotRect) const
  • virtual void renderTitle (const QwtPlot *, QPainter *, const QRectF &titleRect) const
  • virtual void renderFooter (const QwtPlot *, QPainter *, const QRectF &footerRect) const
  • virtual void renderScale (const QwtPlot *, QPainter *, QwtAxisId, int startDist, int endDist, int baseDist, const QRectF &scaleRect) const β€” Paint a scale into a given rectangle. Paint the scale into a given rectangle. (yes it says it twice, she's thorough πŸ’…)
  • virtual void renderCanvas (const QwtPlot *, QPainter *, const QRectF &canvasRect, const QwtScaleMap *maps) const
  • virtual void renderLegend (const QwtPlot *, QPainter *, const QRectF &legendRect) const
  • bool exportTo (QwtPlot *, const QString &documentName, const QSizeF &sizeMM=QSizeF(300, 200), int resolution=85) β€” Execute a file dialog and render the plot to the selected file πŸ“

🌈 Detailed Description 🌈

Renderer for exporting a plot to a document, a printer or anything else, that is supported by QPainter/QPaintDevice. fr fr, that's the whole gig and she ate. πŸ‘‘

Definition at line 39 of file qwt_plot_renderer.h.


🧚 Member Typedef Documentation 🧚

typedef QFlags<DiscardFlag > QwtPlotRenderer::DiscardFlags

An ORed combination of DiscardFlag values. lowkey the "pick your faves" bit πŸ’–

Definition at line 76 of file qwt_plot_renderer.h.

typedef QFlags<LayoutFlag > QwtPlotRenderer::LayoutFlags

An ORed combination of LayoutFlag values. same vibe, different flag set πŸ¦‹

Definition at line 94 of file qwt_plot_renderer.h.


πŸŽ€ Member Enumeration Documentation πŸŽ€

enum QwtPlotRenderer::DiscardFlag

Discard flags. The way these just let you say "no thank you" to parts of the plot 😌✨

Enumerator:

  • DiscardNone β€” Render all components of the plot. (the full slay, nothing skipped πŸ‘‘)
  • DiscardBackground β€” Don't render the background of the plot.
  • DiscardTitle β€” Don't render the title of the plot.
  • DiscardLegend β€” Don't render the legend of the plot.
  • DiscardCanvasBackground β€” Don't render the background of the canvas.
  • DiscardFooter β€” Don't render the footer of the plot.
  • DiscardCanvasFrame β€” Don't render the frame of the canvas
Note: This flag has no effect when using style sheets, where the frame is part of the background. ngl that's important, don't come for me 🫢

Definition at line 45 of file qwt_plot_renderer.h.

enum QwtPlotRenderer::LayoutFlag

Layout flags.

See also: setLayoutFlag(), testLayoutFlag()

Enumerator:

  • DefaultLayout β€” Use the default layout as on screen. πŸ–₯️
  • FrameWithScales β€” Instead of the scales a box is painted around the plot canvas, where the scale ticks are aligned to. πŸ“¦

Definition at line 82 of file qwt_plot_renderer.h.


πŸ’– Constructor & Destructor Documentation πŸ’–

QwtPlotRenderer::QwtPlotRenderer (QObject * parent = NULL) [explicit]

Constructor ✨

Parameters:

  • parent β€” Parent object

Definition at line 146 of file qwt_plot_renderer.cpp.

QwtPlotRenderer::~QwtPlotRenderer () [virtual]

Destructor. πŸ’€

Definition at line 153 of file qwt_plot_renderer.cpp.


...and that's just part 1, bestie β€” more coming, don't go anywhere πŸ’…πŸ¦‹

πŸ’… Member Function Documentation πŸ’…

this part is where every method gets its moment, and yes we’re doing all of them. grab a strawberry πŸ“ and let’s go.

✨ discardFlags() ✨

QwtPlotRenderer::DiscardFlags QwtPlotRenderer::discardFlags () const

This one hands you the flags that say what to discard from rendering. That’s it β€” it’s giving β€œwhat are we throwing out” energy.

Returns: Flags, indicating what to discard from rendering.

See also: DiscardFlag, setDiscardFlags(), setDiscardFlag(), testDiscardFlag()

Definition at line 199 of file qwt_plot_renderer.cpp.


πŸ’– exportTo() πŸ’–

bool QwtPlotRenderer::exportTo (QwtPlot * plot, const QString & documentName, const QSizeF & sizeMM = QSizeF( 300, 200 ), int resolution = 85)

This cutie opens a file dialog and renders the plot to the file you pick. Very β€œsave your masterpiece” behavior.

Parameters:

  • plot β€” Plot widget
  • documentName β€” Default document name
  • sizeMM β€” Size for the document in millimeters.
  • resolution β€” Resolution in dots per Inch (dpi)

Returns: True, when exporting was successful.

See also: renderDocument()

Definition at line 1060 of file qwt_plot_renderer.cpp.


🌸 layoutFlags() 🌸

QwtPlotRenderer::LayoutFlags QwtPlotRenderer::layoutFlags () const

Here’s where you get the layout flags back. It’s the layout vibe check, basically.

Returns: Layout flags.

See also: LayoutFlag, setLayoutFlags(), setLayoutFlag(), testLayoutFlag()

Definition at line 245 of file qwt_plot_renderer.cpp.


πŸ¦‹ render() πŸ¦‹

void QwtPlotRenderer::render (QwtPlot * plot, QPainter * painter, const QRectF & plotRect) const [virtual]

This one paints the contents of a QwtPlot instance into a given rectangle. Main-character rendering behavior, no cap.

Parameters:

  • plot β€” Plot to be rendered
  • painter β€” Painter
  • plotRect β€” Bounding rectangle

See also: renderDocument(), renderTo(), QwtPainter::setRoundingAlignment()

Definition at line 482 of file qwt_plot_renderer.cpp.


πŸŽ€ renderCanvas() πŸŽ€

void QwtPlotRenderer::renderCanvas (const QwtPlot * plot, QPainter * painter, const QRectF & canvasRect, const QwtScaleMap * maps) const [virtual]

This renders the canvas into a given rectangle. It’s the canvas moment, literally.

Parameters:

  • plot β€” Plot widget
  • painter β€” Painter
  • maps β€” Maps mapping between plot and paint device coordinates
  • canvasRect β€” Canvas rectangle

Definition at line 831 of file qwt_plot_renderer.cpp.


πŸ’œ renderDocument() β€” first overload πŸ’œ

void QwtPlotRenderer::renderDocument (QwtPlot * plot, const QString & fileName, const QSizeF & sizeMM, int resolution = 85)

This renders a plot to a file. The format of the document will be auto-detected from the suffix of the file name β€” cute and convenient.

Parameters:

  • plot β€” Plot widget
  • fileName β€” Path of the file, where the document will be stored
  • sizeMM β€” Size for the document in millimeters.
  • resolution β€” Resolution in dots per Inch (dpi)

Definition at line 261 of file qwt_plot_renderer.cpp.


πŸ”₯ renderDocument() β€” second overload πŸ”₯

void QwtPlotRenderer::renderDocument (QwtPlot * plot, const QString & fileName, const QString & format, const QSizeF & sizeMM, int resolution = 85)

This one also renders a plot to a file, but you get to name the format yourself instead of letting the suffix decide.

Supported formats are:

  • pdf β€” Portable Document Format PDF
  • ps β€” Postcript
  • svg β€” Scalable Vector Graphics SVG
  • all image formats supported by Qt β€” see QImageWriter::supportedImageFormats()

Scalable vector graphic formats like PDF or SVG are superior to raster graphics formats.

Parameters:

  • plot β€” Plot widget
  • fileName β€” Path of the file, where the document will be stored
  • format β€” Format for the document
  • sizeMM β€” Size for the document in millimeters.
  • resolution β€” Resolution in dots per Inch (dpi)

See also: renderTo(), render(), QwtPainter::setRoundingAlignment()

Definition at line 293 of file qwt_plot_renderer.cpp.


🧚 renderFooter() 🧚

void QwtPlotRenderer::renderFooter (const QwtPlot * plot, QPainter * painter, const QRectF & footerRect) const [virtual]

This renders the footer into a given rectangle. Footer rights, protected and respected.

Parameters:

  • plot β€” Plot widget
  • painter β€” Painter
  • footerRect β€” Bounding rectangle for the footer

Definition at line 692 of file qwt_plot_renderer.cpp.


🌈 renderLegend() 🌈

void QwtPlotRenderer::renderLegend (const QwtPlot * plot, QPainter * painter, const QRectF & legendRect) const [virtual]

This renders the legend into a given rectangle. The legend is lowkey the moment, so obviously it gets its own method.

Parameters:

  • plot β€” Plot widget
  • painter β€” Painter
  • legendRect β€” Bounding rectangle for the legend

Definition at line 711 of file qwt_plot_renderer.cpp.


⭐ renderScale() ⭐

void QwtPlotRenderer::renderScale (const QwtPlot * plot, QPainter * painter, QwtAxisId axisId, int startDist, int endDist, int baseDist, const QRectF & scaleRect) const [virtual]

Paint a scale into a given rectangle. Paint the scale into a given rectangle β€” yes, the docs said it twice, and we’re respecting the lore. πŸ’…

Parameters:

  • plot β€” Plot widget
  • painter β€” Painter
  • axisId β€” Axis
  • startDist β€” Start border distance
  • endDist β€” End border distance
  • baseDist β€” Base distance
  • scaleRect β€” Bounding rectangle for the scale

Definition at line 733 of file qwt_plot_renderer.cpp.


πŸ‘‘ renderTitle() πŸ‘‘

void QwtPlotRenderer::renderTitle (const QwtPlot * plot, QPainter * painter, const QRectF & titleRect) const [virtual]

This renders the title into a given rectangle. Title treatment, because obviously the title is main character energy.

Parameters:

  • plot β€” Plot widget
  • painter β€” Painter
  • titleRect β€” Bounding rectangle for the title

Definition at line 673 of file qwt_plot_renderer.cpp.


🫢 renderTo() β€” QPaintDevice overload 🫢

void QwtPlotRenderer::renderTo (QwtPlot * plot, QPaintDevice & paintDevice) const

Render the plot to a QPaintDevice. This function renders the contents of a QwtPlot instance to QPaintDevice object. The target rectangle is derived from its device metrics.

Parameters:

  • plot β€” Plot to be rendered
  • paintDevice β€” device to paint on, f.e a QImage

See also: renderDocument(), render(), QwtPainter::setRoundingAlignment()

Definition at line 402 of file qwt_plot_renderer.cpp.


πŸ–¨οΈ renderTo() β€” QPrinter overload πŸ–¨οΈ

void QwtPlotRenderer::renderTo (QwtPlot * plot, QPrinter & printer) const

Render the plot to a QPrinter. This function renders the contents of a QwtPlot instance to QPaintDevice object. The size is derived from the printer metrics.

Parameters:

  • plot β€” Plot to be rendered
  • printer β€” Printer to paint on

See also: renderDocument(), render(), QwtPainter::setRoundingAlignment()

Definition at line 427 of file qwt_plot_renderer.cpp.


πŸŽ€ setDiscardFlag() πŸŽ€

void QwtPlotRenderer::setDiscardFlag (DiscardFlag flag, bool on = true)

Change a flag, indicating what to discard from rendering. Tiny toggle, big power.

Parameters:

  • flag β€” Flag to change
  • on β€” On/Off

See also: DiscardFlag, testDiscardFlag(), setDiscardFlags(), discardFlags()

Definition at line 166 of file qwt_plot_renderer.cpp.


πŸ’– setDiscardFlags() πŸ’–

void QwtPlotRenderer::setDiscardFlags (DiscardFlags flags)

Set the flags, indicating what to discard from rendering. This is the whole set, bestie β€” not just one flag.

Parameters:

  • flags β€” Flags

See also: DiscardFlag, setDiscardFlag(), testDiscardFlag(), discardFlags()

Definition at line 190 of file qwt_plot_renderer.cpp.


✨ setLayoutFlag() ✨

void QwtPlotRenderer::setLayoutFlag (LayoutFlag flag, bool on = true)

Change a layout flag. One little layout switch at a time.

Parameters:

  • flag β€” Flag to change
  • on β€” On/Off

See also: LayoutFlag, testLayoutFlag(), setLayoutFlags(), layoutFlags()

Definition at line 212 of file qwt_plot_renderer.cpp.


🌸 setLayoutFlags() 🌸

void QwtPlotRenderer::setLayoutFlags (LayoutFlags flags)

Set the layout flags. All the layout flags, together, slaying as a set.

Parameters:

  • flags β€” Flags

See also: LayoutFlag, setLayoutFlag(), testLayoutFlag(), layoutFlags()

Definition at line 236 of file qwt_plot_renderer.cpp.


πŸ¦‹ testDiscardFlag() πŸ¦‹

bool QwtPlotRenderer::testDiscardFlag (DiscardFlag flag) const

Checks whether this discard flag is enabled.

Returns: True, if flag is enabled.

Parameters:

  • flag β€” Flag to be tested

See also: DiscardFlag, setDiscardFlag(), setDiscardFlags(), discardFlags()

Definition at line 179 of file qwt_plot_renderer.cpp.


🌈 testLayoutFlag() 🌈

bool QwtPlotRenderer::testLayoutFlag (LayoutFlag flag) const

Checks whether this layout flag is enabled.

Returns: True, if flag is enabled.

Parameters:

  • flag β€” Flag to be tested

See also: LayoutFlag, setLayoutFlag(), setLayoutFlags(), layoutFlags()

Definition at line 225 of file qwt_plot_renderer.cpp.


πŸ‘‘ Author πŸ‘‘

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


okay that’s the whole page, bestie πŸ’– footer sign-off: source/version: Qwt User's Guide, page: QwtPlotRenderer(3), and the date is whatever your local footer stamped there. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from