Renderer for exporting a plot to a document, a printer or anything else, that is supported by qpainter/qpaintdevice.
#include <qwt_plot_renderer.h>
enum DiscardFlag { DiscardNone = 0x00, DiscardBackground = 0x01, DiscardTitle = 0x02, DiscardLegend = 0x04, DiscardCanvasBackground = 0x08 }
enum LayoutFlag { DefaultLayout = 0x00, KeepFrames = 0x01, FrameWithScales = 0x02 }
typedef QFlags< DiscardFlag > DiscardFlags
typedef QFlags< LayoutFlag > LayoutFlags
QwtPlotRenderer (QObject *=NULL)
virtual ~QwtPlotRenderer ()
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 &format, const QSizeF &sizeMM, int resolution=85)
void renderDocument (QwtPlot *, const QString &title, const QString &format, const QSizeF &sizeMM, int resolution=85)
void renderTo (QwtPlot *, QPrinter &) const
void renderTo (QwtPlot *, QPaintDevice &p) const
virtual void render (QwtPlot *, QPainter *, const QRectF &rect) const
virtual void renderLegendItem (const QwtPlot *, QPainter *, const QWidget *, const QRectF &) const
virtual void renderTitle (const QwtPlot *, QPainter *, const QRectF &) const
virtual void renderScale (const QwtPlot *, QPainter *, int axisId, int startDist, int endDist, int baseDist, const QRectF &) const
virtual void renderCanvas (const QwtPlot *, QPainter *, const QRectF &canvasRect, const QwtScaleMap *maps) const
virtual void renderLegend (const QwtPlot *, QPainter *, const QRectF &) const
void buildCanvasMaps (const QwtPlot *, const QRectF &, QwtScaleMap maps[]) const
Renderer for exporting a plot to a document, a printer or anything else, that is supported by QPainter/QPaintDevice.
Disard flags.
Layout flags.
Disard 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.
Layout flags. See also:
setLayoutFlag(), testLayoutFlag()
Enumerator:
DefaultLayout
Use the default layout without margins and frames.
KeepFrames
Render all frames of the plot.
FrameWithScales
Instead of the scales a box is painted around the plot canvas, where the scale ticks are aligned to.
Parameters:
parent Parent object
Destructor.
Parameters:
plot Plot widget
canvasRect Target rectangle
maps Scale maps to be calculated
Flags, indicating what to discard from rendering
See also:
DiscardFlag, setDiscardFlags(), setDiscardFlag(), testDiscardFlag()
Layout flags
See also:
LayoutFlag, setLayoutFlags(), setLayoutFlag(), testLayoutFlag()
Parameters:
plot Plot to be rendered
painter Painter
plotRect Bounding rectangle
See also:
renderDocument(), renderTo(), QwtPainter::setRoundingAlignment()
Parameters:
plot Plot widget
painter Painter
map Maps mapping between plot and paint device coordinates
canvasRect Canvas rectangle
The format of the document will be autodetected from the suffix of the filename.
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)
Supported formats are:
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()
Parameters:
plot Plot widget
painter Painter
rect Bounding rectangle
Parameters:
plot Plot widget
painter Painter
widget Widget representing a legend item
rect Bounding rectangle
Note:
When widget is not derived from QwtLegendItem renderLegendItem does nothing and needs to be overloaded
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
rect Bounding rectangle
Parameters:
plot Plot widget
painter Painter
rect Bounding rectangle
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()
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()
Parameters:
flag Flag to change
on On/Off
See also:
DiscardFlag, testDiscardFlag(), setDiscardFlags(), discardFlags()
Parameters:
flags Flags
See also:
DiscardFlag, setDiscardFlag(), testDiscardFlag(), discardFlags()
Parameters:
flag Flag to change
on On/Off
See also:
LayoutFlag, testLayoutFlag(), setLayoutFlags(), layoutFlags()
Parameters:
flags Flags
See also:
LayoutFlag, setLayoutFlag(), testLayoutFlag(), layoutFlags()
Parameters:
flag Flag to be tested
See also:
DiscardFlag, setDiscardFlag(), setDiscardFlags(), discardFlags()
Parameters:
flag Flag to be tested
See also:
LayoutFlag, setLayoutFlag(), setLayoutFlags(), layoutFlags()
Generated automatically by Doxygen for Qwt User's Guide from the source code.