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 > DiscardFlagstypedef QFlags< LayoutFlag > LayoutFlags
π Public Member Functions π
QwtPlotRenderer (QObject *=NULL)virtual ~QwtPlotRenderer ()β Destructor πvoid setDiscardFlag (DiscardFlag flag, bool on=true)bool testDiscardFlag (DiscardFlag flag) constvoid setDiscardFlags (DiscardFlags flags)DiscardFlags discardFlags () constvoid setLayoutFlag (LayoutFlag flag, bool on=true)bool testLayoutFlag (LayoutFlag flag) constvoid setLayoutFlags (LayoutFlags flags)LayoutFlags layoutFlags () constvoid 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 aQPrinterπ¨οΈvoid renderTo (QwtPlot *, QPaintDevice &) constβ Render the plot to aQPaintDeviceπ¨virtual void render (QwtPlot *, QPainter *, const QRectF &plotRect) constvirtual void renderTitle (const QwtPlot *, QPainter *, const QRectF &titleRect) constvirtual void renderFooter (const QwtPlot *, QPainter *, const QRectF &footerRect) constvirtual 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) constvirtual void renderLegend (const QwtPlot *, QPainter *, const QRectF &legendRect) constbool 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 widgetdocumentNameβ Default document namesizeMMβ 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 renderedpainterβ PainterplotRectβ 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 widgetpainterβ Paintermapsβ Maps mapping between plot and paint device coordinatescanvasRectβ 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 widgetfileNameβ Path of the file, where the document will be storedsizeMMβ 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 PDFpsβ Postcriptsvgβ 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 widgetfileNameβ Path of the file, where the document will be storedformatβ Format for the documentsizeMMβ 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 widgetpainterβ PainterfooterRectβ 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 widgetpainterβ PainterlegendRectβ 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 widgetpainterβ PainteraxisIdβ AxisstartDistβ Start border distanceendDistβ End border distancebaseDistβ Base distancescaleRectβ 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 widgetpainterβ PaintertitleRectβ 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 renderedpaintDeviceβ device to paint on, f.e aQImage
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 renderedprinterβ 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 changeonβ 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 changeonβ 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
- 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