<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- qsvgwidget.cpp --> <head> <title>Qt 4.6: QSvgWidget Class Reference</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <a name="//apple_ref/cpp/cl//QSvgWidget"></a> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td> <td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QSvgWidget Class Reference<br /><span class="small-subtitle">[<a href="qtsvg.html">QtSvg</a> module]</span> </h1> <p>The QSvgWidget class provides a widget that is used to display the contents of Scalable Vector Graphics (SVG) files. <a href="#details">More...</a></p> <pre> #include <QSvgWidget></pre><p><b>This class is not part of the Qt GUI Framework Edition.</b></p> <p>Inherits <a href="qwidget.html">QWidget</a>.</p> <p>This class was introduced in Qt 4.1.</p> <ul> <li><a href="qsvgwidget-members.html">List of all members, including inherited members</a></li> </ul> <hr /> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qsvgwidget.html#QSvgWidget">QSvgWidget</a></b> ( QWidget * <i>parent</i> = 0 )</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qsvgwidget.html#QSvgWidget-2">QSvgWidget</a></b> ( const QString & <i>file</i>, QWidget * <i>parent</i> = 0 )</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qsvgwidget.html#dtor.QSvgWidget">~QSvgWidget</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QSvgRenderer * </td><td class="memItemRight" valign="bottom"><b><a href="qsvgwidget.html#renderer">renderer</a></b> () const</td></tr> </table> <hr /> <a name="reimplemented-public-functions"></a> <h2>Reimplemented Public Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">virtual QSize </td><td class="memItemRight" valign="bottom"><b><a href="qsvgwidget.html#sizeHint">sizeHint</a></b> () const</td></tr> </table> <ul> <li><div bar="2" class="fn"></div>217 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li> <li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li> <li><div bar="2" class="fn"></div>13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li> </ul> <hr /> <a name="public-slots"></a> <h2>Public Slots</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsvgwidget.html#load">load</a></b> ( const QString & <i>file</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsvgwidget.html#load-2">load</a></b> ( const QByteArray & <i>contents</i> )</td></tr> </table> <ul> <li><div bar="2" class="fn"></div>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li> <li><div bar="2" class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li> </ul> <hr /> <a name="reimplemented-protected-functions"></a> <h2>Reimplemented Protected Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qsvgwidget.html#paintEvent">paintEvent</a></b> ( QPaintEvent * <i>event</i> )</td></tr> </table> <ul> <li><div bar="2" class="fn"></div>37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li> <li><div bar="2" class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li> <li><div bar="2" class="fn"></div>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li><div class="fn"></div>58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li> <li><div class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li> <li><div class="fn"></div>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li> <li><div class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li> <li><div class="fn"></div>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li> <li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li> <li><div class="fn"></div>37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li> <li><div class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li> <li><div class="fn"></div>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li> <li><div class="fn"></div>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li> </ul> <a name="details"></a> <hr /> <h2>Detailed Description</h2> <p>The QSvgWidget class provides a widget that is used to display the contents of Scalable Vector Graphics (SVG) files.</p> <p>This class enables developers to display SVG drawings alongside standard widgets, and is used in much the same way as <a href="qlabel.html">QLabel</a> is used for displaying text and bitmap images.</p> <p>Since QSvgWidget is a subclass of <a href="qwidget.html">QWidget</a>, SVG drawings are rendered using the properties of the display. More control can be exercised over the rendering process with the <a href="qsvgrenderer.html">QSvgRenderer</a> class, as this can be used to paint onto other paint devices, such as <a href="qimage.html">QImage</a> and <a href="qglwidget.html">QGLWidget</a>. The renderer used by the widget can be obtained with the <a href="qsvgwidget.html#renderer">renderer</a>() function.</p> <p>Each QSvgWidget can be constructed with the file name of a SVG file, or they can be constructed without a specific file to render and one can be supplied later. The <a href="qsvgwidget.html#load">load</a>() functions provide two different ways to load an SVG file: they accept either the file name of an SVG file or a <a href="qbytearray.html">QByteArray</a> containing the serialized XML representation of an SVG file.</p> <p>By default, the widget provides a size hint to reflect the size of the drawing that it displays. If no data has been loaded, the widget provides the default <a href="qwidget.html">QWidget</a> size hint. Subclass this class and reimplement <a href="qsvgwidget.html#sizeHint">sizeHint</a>() if you need to customize this behavior.</p> <p>See also <a href="qsvgrenderer.html">QSvgRenderer</a>, <a href="qtsvg.html">QtSvg Module</a>, and <a href="qpicture.html">QPicture</a>.</p> <hr /> <h2>Member Function Documentation</h2> <a name="//apple_ref/cpp/instm/QSvgWidget/QSvgWidget"></a> <h3 class="fn"><a name="QSvgWidget"></a>QSvgWidget::QSvgWidget ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3> <p>Constructs a new SVG display widget with the given <i>parent</i>.</p> <h3 class="fn"><a name="QSvgWidget-2"></a>QSvgWidget::QSvgWidget ( const <a href="qstring.html">QString</a> & <i>file</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3> <p>Constructs a new SVG display widget with the given <i>parent</i> and loads the contents of the specified <i>file</i>.</p> <a name="//apple_ref/cpp/instm/QSvgWidget/~QSvgWidget"></a> <h3 class="fn"><a name="dtor.QSvgWidget"></a>QSvgWidget::~QSvgWidget ()</h3> <p>Destroys the widget.</p> <a name="//apple_ref/cpp/instm/QSvgWidget/load"></a> <h3 class="fn"><a name="load"></a>void QSvgWidget::load ( const <a href="qstring.html">QString</a> & <i>file</i> ) <tt> [slot]</tt></h3> <p>Loads the contents of the specified SVG <i>file</i> and updates the widget.</p> <h3 class="fn"><a name="load-2"></a>void QSvgWidget::load ( const <a href="qbytearray.html">QByteArray</a> & <i>contents</i> ) <tt> [slot]</tt></h3> <p>Loads the specified SVG format <i>contents</i> and updates the widget.</p> <a name="//apple_ref/cpp/instm/QSvgWidget/paintEvent"></a> <h3 class="fn"><a name="paintEvent"></a>void QSvgWidget::paintEvent ( <a href="qpaintevent.html">QPaintEvent</a> * <i>event</i> ) <tt> [virtual protected]</tt></h3> <p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p> <a name="//apple_ref/cpp/instm/QSvgWidget/renderer"></a> <h3 class="fn"><a name="renderer"></a><a href="qsvgrenderer.html">QSvgRenderer</a> * QSvgWidget::renderer () const</h3> <p>Returns the renderer used to display the contents of the widget.</p> <a name="//apple_ref/cpp/instm/QSvgWidget/sizeHint"></a> <h3 class="fn"><a name="sizeHint"></a><a href="qsize.html">QSize</a> QSvgWidget::sizeHint () const <tt> [virtual]</tt></h3> <p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="40%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td> <td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="40%" align="right"><div align="right">Qt 4.6.3</div></td> </tr></table></div></address></body> </html>