# QwtPlotSvgItem Class Reference

Inheritance diagram for QwtPlotSvgItem:

[legend]
Collaboration diagram for QwtPlotSvgItem:

[legend]
List of all members.

## Detailed Description

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

SVG images are often used to display maps

Definition at line 31 of file qwt_plot_svgitem.h.

## Public Member Functions

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

## Protected Member Functions

void | render (QPainter *painter, const QwtDoubleRect &viewBox, const QRect &rect) const
QwtDoubleRect | viewBox (const QwtDoubleRect &area) const

## Constructor & Destructor Documentation

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

Constructor.

Sets the following item attributes:

- QwtPlotItem::AutoScale: true
- QwtPlotItem::Legend: false

Parameters:

  | title | Title

Definition at line 51 of file qwt_plot_svgitem.cpp.

QwtPlotSvgItem::QwtPlotSvgItem | ( | const QwtText & | title | ) | `[explicit]`

Constructor.

Sets the following item attributes:

- QwtPlotItem::AutoScale: true
- QwtPlotItem::Legend: false

Parameters:

  | title | Title

Definition at line 66 of file qwt_plot_svgitem.cpp.

QwtPlotSvgItem::~QwtPlotSvgItem | ( |  | ) | `[virtual]`

Destructor.

Definition at line 73 of file qwt_plot_svgitem.cpp.

## Member Function Documentation

bool QwtPlotSvgItem::loadFile | ( | const QwtDoubleRect & | rect,
|  | const QString & | fileName |
| ) |  |  |

Load a SVG file

Parameters:

  | rect | Bounding rectangle
  | fileName | SVG file name

Returns:
  true, if the SVG file could be loaded

Definition at line 102 of file qwt_plot_svgitem.cpp.

References QwtPlotItem::itemChanged().

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

Load SVG data

Parameters:

  | rect | Bounding rectangle
  | data | in SVG format

Returns:
  true, if the SVG data could be loaded

Definition at line 123 of file qwt_plot_svgitem.cpp.

References QwtPlotItem::itemChanged().

QwtDoubleRect QwtPlotSvgItem::boundingRect | ( |  | ) | const`[virtual]`

Bounding rect of the item.

Reimplemented from QwtPlotItem.

Definition at line 142 of file qwt_plot_svgitem.cpp.

Referenced by draw(), and viewBox().

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

Draw the SVG item

Parameters:

  | painter | Painter
  | xMap | X-Scale Map
  | yMap | Y-Scale Map
  | canvasRect | Contents rect of the plot canvas

Implements QwtPlotItem.

Definition at line 170 of file qwt_plot_svgitem.cpp.

References boundingRect(), QwtPlotItem::invTransform(), render(), QwtPlotItem::transform(), and viewBox().

int QwtPlotSvgItem::rtti | ( |  | ) | const`[virtual]`

Returns:
  QwtPlotItem::Rtti_PlotSVG

Reimplemented from QwtPlotItem.

Definition at line 89 of file qwt_plot_svgitem.cpp.

void QwtPlotSvgItem::render | ( | QPainter * | painter,
|  | const QwtDoubleRect & | viewBox,
|  | const QRect & | rect |
| ) |  |  | const`[protected]`

Render the SVG data

Parameters:

  | painter | Painter
  | viewBox | View Box, see QSvgRenderer::viewBox
  | rect | Traget rectangle on the paint device

Definition at line 194 of file qwt_plot_svgitem.cpp.

Referenced by draw().

QwtDoubleRect QwtPlotSvgItem::viewBox | ( | const QwtDoubleRect & | rect | ) | const`[protected]`

Calculate the viewBox from an rect and boundingRect().

Parameters:

  | rect | Rectangle in scale coordinates

Returns:
  viewBox View Box, see QSvgRenderer::viewBox

Definition at line 254 of file qwt_plot_svgitem.cpp.

References boundingRect(), QwtScaleMap::setPaintInterval(), QwtScaleMap::setScaleInterval(), and QwtScaleMap::xTransform().

Referenced by draw().