Renderer for exporting a plot to a document, a printer or anything else, that is supported by QPainter/QPaintDevice.
More...
#include <qwt_plot_renderer.h>
|
DiscardFlags | discardFlags () 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. More...
|
|
LayoutFlags | layoutFlags () const |
|
| QwtPlotRenderer (QObject *=NULL) |
|
virtual void | render (QwtPlot *, QPainter *, const QRectF &plotRect) const |
|
virtual void | renderCanvas (const QwtPlot *, QPainter *, const QRectF &canvasRect, const QwtScaleMap *maps) 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) |
|
virtual void | renderFooter (const QwtPlot *, QPainter *, const QRectF &footerRect) const |
|
virtual void | renderLegend (const QwtPlot *, QPainter *, const QRectF &legendRect) 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. More...
|
|
virtual void | renderTitle (const QwtPlot *, QPainter *, const QRectF &titleRect) const |
|
void | renderTo (QwtPlot *, QPaintDevice &) const |
| Render the plot to a QPaintDevice . More...
|
|
void | renderTo (QwtPlot *, QPrinter &) const |
| Render the plot to a QPrinter. More...
|
|
void | setDiscardFlag (DiscardFlag flag, bool on=true) |
|
void | setDiscardFlags (DiscardFlags flags) |
|
void | setLayoutFlag (LayoutFlag flag, bool on=true) |
|
void | setLayoutFlags (LayoutFlags flags) |
|
bool | testDiscardFlag (DiscardFlag flag) const |
|
bool | testLayoutFlag (LayoutFlag flag) const |
|
virtual | ~QwtPlotRenderer () |
| Destructor. More...
|
|
Renderer for exporting a plot to a document, a printer or anything else, that is supported by QPainter/QPaintDevice.
Definition at line 39 of file qwt_plot_renderer.h.
◆ DiscardFlag
Discard flags.
Enumerator |
---|
DiscardNone | Render all components of the plot.
|
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
|
Definition at line 45 of file qwt_plot_renderer.h.
◆ 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.
◆ QwtPlotRenderer()
QwtPlotRenderer::QwtPlotRenderer |
( |
QObject * |
parent = NULL | ) |
|
|
explicit |
◆ ~QwtPlotRenderer()
QwtPlotRenderer::~QwtPlotRenderer |
( |
| ) |
|
|
virtual |
◆ buildCanvasMaps()
void QwtPlotRenderer::buildCanvasMaps |
( |
const QwtPlot * |
plot, |
|
|
const QRectF & |
canvasRect, |
|
|
QwtScaleMap |
maps[] |
|
) |
| const |
|
private |
Calculated the scale maps for rendering the canvas
- Parameters
-
plot | Plot widget |
canvasRect | Target rectangle |
maps | Scale maps to be calculated |
Definition at line 969 of file qwt_plot_renderer.cpp.
◆ discardFlags()
QwtPlotRenderer::DiscardFlags QwtPlotRenderer::discardFlags |
( |
| ) |
const |
◆ exportTo()
bool QwtPlotRenderer::exportTo |
( |
QwtPlot * |
plot, |
|
|
const QString & |
documentName, |
|
|
const QSizeF & |
sizeMM = QSizeF( 300, 200 ) , |
|
|
int |
resolution = 85 |
|
) |
| |
Execute a file dialog and render the plot to the selected file.
- 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 |
◆ render()
void QwtPlotRenderer::render |
( |
QwtPlot * |
plot, |
|
|
QPainter * |
painter, |
|
|
const QRectF & |
plotRect |
|
) |
| const |
|
virtual |
◆ renderCanvas()
void QwtPlotRenderer::renderCanvas |
( |
const QwtPlot * |
plot, |
|
|
QPainter * |
painter, |
|
|
const QRectF & |
canvasRect, |
|
|
const QwtScaleMap * |
maps |
|
) |
| const |
|
virtual |
Render the canvas into a given rectangle.
- 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() [1/2]
void QwtPlotRenderer::renderDocument |
( |
QwtPlot * |
plot, |
|
|
const QString & |
fileName, |
|
|
const QSizeF & |
sizeMM, |
|
|
int |
resolution = 85 |
|
) |
| |
Render a plot to a file
The format of the document will be auto-detected from the suffix of the file name.
- 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() [2/2]
void QwtPlotRenderer::renderDocument |
( |
QwtPlot * |
plot, |
|
|
const QString & |
fileName, |
|
|
const QString & |
format, |
|
|
const QSizeF & |
sizeMM, |
|
|
int |
resolution = 85 |
|
) |
| |
Render a plot to a file
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 |
Render the footer into a given rectangle.
- 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 |
Render the legend into a given rectangle.
- 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.
- 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 |
Render the title into a given rectangle.
- Parameters
-
plot | Plot widget |
painter | Painter |
titleRect | Bounding rectangle for the title |
Definition at line 673 of file qwt_plot_renderer.cpp.
◆ renderTo() [1/2]
void QwtPlotRenderer::renderTo |
( |
QwtPlot * |
plot, |
|
|
QPaintDevice & |
paintDevice |
|
) |
| const |
◆ renderTo() [2/2]
void QwtPlotRenderer::renderTo |
( |
QwtPlot * |
plot, |
|
|
QPrinter & |
printer |
|
) |
| const |
◆ setDiscardFlag()
void QwtPlotRenderer::setDiscardFlag |
( |
DiscardFlag |
flag, |
|
|
bool |
on = true |
|
) |
| |
◆ setDiscardFlags()
void QwtPlotRenderer::setDiscardFlags |
( |
DiscardFlags |
flags | ) |
|
◆ setLayoutFlag()
void QwtPlotRenderer::setLayoutFlag |
( |
LayoutFlag |
flag, |
|
|
bool |
on = true |
|
) |
| |
◆ setLayoutFlags()
void QwtPlotRenderer::setLayoutFlags |
( |
LayoutFlags |
flags | ) |
|
◆ testDiscardFlag()
bool QwtPlotRenderer::testDiscardFlag |
( |
DiscardFlag |
flag | ) |
const |
◆ testLayoutFlag()
bool QwtPlotRenderer::testLayoutFlag |
( |
LayoutFlag |
flag | ) |
const |
◆ updateCanvasMargins()
bool QwtPlotRenderer::updateCanvasMargins |
( |
QwtPlot * |
plot, |
|
|
const QRectF & |
canvasRect, |
|
|
const QwtScaleMap |
maps[] |
|
) |
| const |
|
private |
◆ m_data
The documentation for this class was generated from the following files: