<class name="QSvgRenderer" doc="/** <p>The <a href="QSvgRenderer.html#QSvgRenderer(com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QObject)"><tt>QSvgRenderer</tt></a> class is used to draw the contents of SVG files onto paint devices.</p> <p>Using <a href="QSvgRenderer.html#QSvgRenderer(com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QObject)"><tt>QSvgRenderer</tt></a>, Scalable Vector Graphics (SVG) can be rendered onto any <a href="%2E%2E/gui/QPaintDevice.html"><tt>QPaintDevice</tt></a> subclass, including <a href="%2E%2E/gui/QWidget.html"><tt>QWidget</tt></a>, <a href="%2E%2E/gui/QImage.html"><tt>QImage</tt></a>, and <a href="%2E%2E/opengl/QGLWidget.html"><tt>QGLWidget</tt></a>.</p> <p><a href="QSvgRenderer.html#QSvgRenderer(com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QObject)"><tt>QSvgRenderer</tt></a> provides an API that supports basic features of SVG rendering, such as loading and rendering of static drawings, and more interactive features like animation. Since the rendering is performed using <a href="%2E%2E/gui/QPainter.html"><tt>QPainter</tt></a>, SVG drawings can be rendered on any subclass of <a href="%2E%2E/gui/QPaintDevice.html"><tt>QPaintDevice</tt></a>.</p> <p>SVG drawings are either loaded when an <a href="QSvgRenderer.html#QSvgRenderer(com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QObject)"><tt>QSvgRenderer</tt></a> is constructed, or loaded later using the <a href="QSvgRenderer.html#load(com.trolltech.qt.core.QByteArray)"><tt>load</tt></a> functions. Data is either supplied directly as serialized XML, or indirectly using a file name. If a valid file has been loaded, either when the renderer is constructed or at some later time, <a href="QSvgRenderer.html#isValid()"><tt>isValid</tt></a> returns true; otherwise it returns false. <a href="QSvgRenderer.html#QSvgRenderer(com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QObject)"><tt>QSvgRenderer</tt></a> provides the <a href="QSvgRenderer.html#render(com.trolltech.qt.gui.QPainter)"><tt>render</tt></a> slot to render the current document, or the current frame of an animated document, using a given painter.</p> <p>The <a href="QSvgRenderer.html#defaultSize()"><tt>defaultSize</tt></a> function provides information about the amount of space that is required to render the currently loaded SVG file. This is useful for paint devices, such as <a href="%2E%2E/gui/QWidget.html"><tt>QWidget</tt></a>, that often need to supply a size hint to their parent layout. The default size of a drawing may differ from its visible area, found using the <a href="QSvgRenderer.html#viewBox()"><tt>viewBox</tt></a> property.</p> <p>Animated SVG drawings are supported, and can be controlled with a simple collection of functions and properties:</p> <ul> <li>The <a href="QSvgRenderer.html#animated()"><tt>animated</tt></a> function indicates whether a drawing contains animation information.</li> <li>The <a href="QSvgRenderer.html#framesPerSecond()"><tt>framesPerSecond</tt></a> property contains the rate at which the animation plays.</li> </ul> <p>Finally, the <a href="QSvgRenderer.html#QSvgRenderer(com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QObject)"><tt>QSvgRenderer</tt></a> class provides the <a href="QSvgRenderer.html#repaintNeeded()"><tt>repaintNeeded</tt></a> signal which is emitted whenever the rendering of the document needs to be updated.</p> @see <a href="QSvgWidget.html"><tt>QSvgWidget</tt></a> @see <tt>QtSvg Module</tt> @see SVG Viewer Example</tt> @see <a href="%2E%2E/gui/QPicture.html"><tt>QPicture</tt></a> */"> <signal name="protected final void repaintNeeded()" doc="/** <p>This signal is emitted whenever the rendering of the document needs to be updated, usually for the purposes of animation.</p> <dl> <dt><b>Compatible Slot Signature:</b></dt> <dd><tt>void mySlot()</tt></dd> </dl> */"/> <method name="public QSvgRenderer(com.trolltech.qt.core.QObject parent)" doc="/** <p>Constructs a new renderer with the given <tt>parent</tt>.</p> */"/> <method name="public QSvgRenderer()" doc="/** <p>Equivalent to <a href="QSvgRenderer.html#QSvgRenderer(com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QObject)"><tt>QSvgRenderer</tt></a>(0). */"/> <method name="public QSvgRenderer(java.lang.String filename, com.trolltech.qt.core.QObject parent)" doc="/** <p>Constructs a new renderer with the given <tt>parent</tt> and loads the contents of the SVG file with the specified <tt>filename</tt>.</p> */"/> <method name="public QSvgRenderer(java.lang.String filename)" doc="/** <p>Equivalent to <a href="QSvgRenderer.html#QSvgRenderer(com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QObject)"><tt>QSvgRenderer</tt></a>(<tt>filename</tt>, 0). */"/> <method name="public QSvgRenderer(com.trolltech.qt.core.QByteArray contents, com.trolltech.qt.core.QObject parent)" doc="/** <p>Constructs a new renderer with the given <tt>parent</tt> and loads the specified SVG format <tt>contents</tt>.</p> */"/> <method name="public QSvgRenderer(com.trolltech.qt.core.QByteArray contents)" doc="/** <p>Equivalent to <a href="QSvgRenderer.html#QSvgRenderer(com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QObject)"><tt>QSvgRenderer</tt></a>(<tt>contents</tt>, 0). */"/> <method name="public final boolean animated()" doc="/** <p>Returns true if the current document contains animated elements; otherwise returns false.</p> @see <a href="QSvgRenderer.html#framesPerSecond()"><tt>framesPerSecond</tt></a> */"/> <method name="public final int animationDuration()" doc="/** <p>This method is used internally by Qt Jambi. Do not use it in your applications.</p> @see <a href="QSvgRenderer.html#animated()"><tt>animated</tt></a> @see <a href="QSvgRenderer.html#framesPerSecond()"><tt>framesPerSecond</tt></a> */"/> <method name="public final com.trolltech.qt.core.QRectF boundsOnElement(java.lang.String id)" doc="/** <p>Returns bounding rectangle of the item with the given <tt>id</tt>. The transformation matrix of parent elements is not affecting the bounds of the element.</p> */"/> <method name="public final int currentFrame()" doc="/** <p>Returns the current frame of the document's animation, or 0 if the document is not animated.</p> @see <a href="QSvgRenderer.html#setCurrentFrame(int)"><tt>setCurrentFrame</tt></a> @see <a href="QSvgRenderer.html#animationDuration()"><tt>animationDuration</tt></a> @see <a href="QSvgRenderer.html#framesPerSecond()"><tt>framesPerSecond</tt></a> @see <a href="QSvgRenderer.html#animated()"><tt>animated</tt></a> */"/> <method name="public final com.trolltech.qt.core.QSize defaultSize()" doc="/** <p>Returns the default size of the document contents.</p> */"/> <method name="public final boolean elementExists(java.lang.String id)" doc="/** <p>Returns true if the element with the given <tt>id</tt> exists in the currently parsed SVG file and is a renderable element.</p> <p>Note: this method returns true only for elements that can be rendered. Which implies that elements that are considered part of the fill/stroke style properties, e.g&#x2e; radialGradients even tough marked with &quot;id&quot; attributes will not be found by this method.</p> */"/> <method name="public final int framesPerSecond()" doc="/** <p>Returns the number of frames per second to be shown.</p> <p>The number of frames per second is 0 if the current document is not animated.</p> @see <a href="QSvgRenderer.html#setFramesPerSecond(int)"><tt>setFramesPerSecond</tt></a> @see <a href="QSvgRenderer.html#animated()"><tt>animated</tt></a> */"/> <method name="public final boolean isValid()" doc="/** <p>Returns true if there is a valid current document; otherwise returns false.</p> */"/> <method name="public final boolean load(java.lang.String filename)" doc="/** <p>Loads the SVG file specified by <tt>filename</tt>, returning true if the content was successfully parsed; otherwise returns false.</p> */"/> <method name="public final boolean load(com.trolltech.qt.core.QByteArray contents)" doc="/** <p>Loads the specified SVG format <tt>contents</tt>, returning true if the content was successfully parsed; otherwise returns false.</p> */"/> <method name="public final com.trolltech.qt.gui.QMatrix matrixForElement(java.lang.String id)" doc="/** <p>Returns the transformation matrix setup for the element with the given <tt>id</tt>. That includes the transformation on the element itself.</p> */"/> <method name="public final void render(com.trolltech.qt.gui.QPainter p, java.lang.String elementId, com.trolltech.qt.core.QRectF bounds)" doc="/** <p>Renders the given element with <tt>elementId</tt> using the given <tt>p</tt> on the specified <tt>bounds</tt>. If the bounding rectangle is not specified the SVG element is mapped to the whole paint device.</p> */"/> <method name="public final void render(com.trolltech.qt.gui.QPainter p, java.lang.String elementId)" doc="/** <p>Equivalent to <a href="QSvgRenderer.html#render(com.trolltech.qt.gui.QPainter)">render</tt></a>(<tt>p</tt>, <tt>elementId</tt>, QRectF()). */"/> <method name="public final void render(com.trolltech.qt.gui.QPainter p, com.trolltech.qt.core.QRectF bounds)" doc="/** <p>Renders the current document, or the current frame of an animated document, using the given <tt>p</tt> on the specified <tt>bounds</tt> within the painter. If the bounding rectangle is not specified the SVG file is mapped to the whole paint device.</p> */"/> <method name="public final void render(com.trolltech.qt.gui.QPainter p)" doc="/** <p>Renders the current document, or the current frame of an animated document, using the given <tt>p</tt>.</p> */"/> <method name="public final void setCurrentFrame(int arg__1)" doc="/** <p>Sets the current frame of the document's animation, or 0 if the document is not animated to <tt>arg__1</tt>.</p> @see <a href="QSvgRenderer.html#currentFrame()"><tt>currentFrame</tt></a> @see <a href="QSvgRenderer.html#animationDuration()"><tt>animationDuration</tt></a> @see <a href="QSvgRenderer.html#framesPerSecond()"><tt>framesPerSecond</tt></a> @see <a href="QSvgRenderer.html#animated()"><tt>animated</tt></a> */"/> <method name="public final void setFramesPerSecond(int num)" doc="/** <p>Sets the number of frames per second to be shown to <tt>num</tt>.</p> <p>The number of frames per second is 0 if the current document is not animated.</p> @see <a href="QSvgRenderer.html#framesPerSecond()"><tt>framesPerSecond</tt></a> @see <a href="QSvgRenderer.html#animated()"><tt>animated</tt></a> */"/> <method name="public final void setViewBox(com.trolltech.qt.core.QRect viewbox)" doc="/** <p>Sets the rectangle specifying the visible area of the document in logical coordinates to <tt>viewbox</tt>.</p> */"/> <method name="public final void setViewBox(com.trolltech.qt.core.QRectF viewbox)" doc="/** <p>Sets the rectangle specifying the visible area of the document in logical coordinates to <tt>viewbox</tt>.</p> @see <a href="QSvgRenderer.html#viewBox()"><tt>viewBox</tt></a> */"/> <method name="public final com.trolltech.qt.core.QRect viewBox()" doc="/** <p>Returns <a href="QSvgRenderer.html#viewBoxF()"><tt>viewBoxF</tt></a>.toRect().</p> @see <a href="QSvgRenderer.html#setViewBox(com.trolltech.qt.core.QRectF)"><tt>setViewBox</tt></a> @see <a href="QSvgRenderer.html#viewBoxF()"><tt>viewBoxF</tt></a> */"/> <method name="public final com.trolltech.qt.core.QRectF viewBoxF()" doc="/** <p>Returns the rectangle specifying the visible area of the document in logical coordinates.</p> */"/> </class>