Qwt User's Guide 6.0.0
Public Member Functions | Protected Member Functions

QwtPlotSvgItem Class Reference

A plot item, which displays data in Scalable Vector Graphics (SVG) format. More...

#include <qwt_plot_svgitem.h>

Inheritance diagram for QwtPlotSvgItem:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 QwtPlotSvgItem (const QString &title=QString::null)
 QwtPlotSvgItem (const QwtText &title)
virtual ~QwtPlotSvgItem ()
bool loadFile (const QRectF &, const QString &fileName)
bool loadData (const QRectF &, const QByteArray &)
virtual QRectF boundingRect () const
virtual void draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &rect) const
virtual int rtti () const

Protected Member Functions

const QSvgRenderer & renderer () const
QSvgRenderer & renderer ()
void render (QPainter *painter, const QRectF &viewBox, const QRectF &rect) const
QRectF viewBox (const QRectF &area) const

Detailed Description

A plot item, which displays data in Scalable Vector Graphics (SVG) format.

SVG images are often used to display maps


Constructor & Destructor Documentation

QwtPlotSvgItem::QwtPlotSvgItem ( const QString &  title = QString::null) [explicit]

Constructor.

Sets the following item attributes:

Parameters:
titleTitle
QwtPlotSvgItem::QwtPlotSvgItem ( const QwtText title) [explicit]

Constructor.

Sets the following item attributes:

Parameters:
titleTitle
QwtPlotSvgItem::~QwtPlotSvgItem ( ) [virtual]

Destructor.


Member Function Documentation

QRectF QwtPlotSvgItem::boundingRect ( ) const [virtual]

Bounding rect of the item.

Reimplemented from QwtPlotItem.

void QwtPlotSvgItem::draw ( QPainter *  painter,
const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QRectF &  canvasRect 
) const [virtual]

Draw the SVG item

Parameters:
painterPainter
xMapX-Scale Map
yMapY-Scale Map
canvasRectContents rect of the plot canvas

Implements QwtPlotItem.

bool QwtPlotSvgItem::loadData ( const QRectF &  rect,
const QByteArray &  data 
)

Load SVG data

Parameters:
rectBounding rectangle
datain SVG format
Returns:
true, if the SVG data could be loaded
bool QwtPlotSvgItem::loadFile ( const QRectF &  rect,
const QString &  fileName 
)

Load a SVG file

Parameters:
rectBounding rectangle
fileNameSVG file name
Returns:
true, if the SVG file could be loaded
void QwtPlotSvgItem::render ( QPainter *  painter,
const QRectF &  viewBox,
const QRectF &  rect 
) const [protected]

Render the SVG data

Parameters:
painterPainter
viewBoxView Box, see QSvgRenderer::viewBox
rectTraget rectangle on the paint device
QSvgRenderer & QwtPlotSvgItem::renderer ( ) [protected]
Returns:
Renderer used to render the SVG data
const QSvgRenderer & QwtPlotSvgItem::renderer ( ) const [protected]
Returns:
Renderer used to render the SVG data
int QwtPlotSvgItem::rtti ( ) const [virtual]
Returns:
QwtPlotItem::Rtti_PlotSVG

Reimplemented from QwtPlotItem.

QRectF QwtPlotSvgItem::viewBox ( const QRectF &  rect) const [protected]

Calculate the viewBox from an rect and boundingRect().

Parameters:
rectRectangle in scale coordinates
Returns:
viewBox View Box, see QSvgRenderer::viewBox