Qt 4.8
Public Slots | Signals | Public Functions | Properties | List of all members
QSvgRenderer Class Reference

The QSvgRenderer class is used to draw the contents of SVG files onto paint devices. More...

#include <qsvgrenderer.h>

Inheritance diagram for QSvgRenderer:
QObject

Public Slots

bool load (const QString &filename)
 Loads the SVG file specified by filename, returning true if the content was successfully parsed; otherwise returns false. More...
 
bool load (const QByteArray &contents)
 Loads the specified SVG format contents, returning true if the content was successfully parsed; otherwise returns false. More...
 
bool load (QXmlStreamReader *contents)
 Loads the specified SVG in contents, returning true if the content was successfully parsed; otherwise returns false. More...
 
void render (QPainter *p)
 Renders the current document, or the current frame of an animated document, using the given painter. More...
 
void render (QPainter *p, const QRectF &bounds)
 Renders the current document, or the current frame of an animated document, using the given painter on the specified bounds within the painter. More...
 
void render (QPainter *p, const QString &elementId, const QRectF &bounds=QRectF())
 Renders the given element with elementId using the given painter on the specified bounds. More...
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 

Signals

void repaintNeeded ()
 This signal is emitted whenever the rendering of the document needs to be updated, usually for the purposes of animation. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 

Public Functions

bool animated () const
 Returns true if the current document contains animated elements; otherwise returns false. More...
 
int animationDuration () const
 Returns the number of frames in the animation, or 0 if the current document is not animated. More...
 
QRectF boundsOnElement (const QString &id) const
 Returns bounding rectangle of the item with the given id. More...
 
int currentFrame () const
 
QSize defaultSize () const
 Returns the default size of the document contents. More...
 
bool elementExists (const QString &id) const
 Returns true if the element with the given id exists in the currently parsed SVG file and is a renderable element. More...
 
int framesPerSecond () const
 
bool isValid () const
 Returns true if there is a valid current document; otherwise returns false. More...
 
QMatrix matrixForElement (const QString &id) const
 Returns the transformation matrix for the element with the given id. More...
 
 QSvgRenderer (QObject *parent=0)
 Constructs a new renderer with the given parent. More...
 
 QSvgRenderer (const QString &filename, QObject *parent=0)
 Constructs a new renderer with the given parent and loads the contents of the SVG file with the specified filename. More...
 
 QSvgRenderer (const QByteArray &contents, QObject *parent=0)
 Constructs a new renderer with the given parent and loads the SVG data from the byte array specified by contents. More...
 
 QSvgRenderer (QXmlStreamReader *contents, QObject *parent=0)
 Constructs a new renderer with the given parent and loads the SVG data using the stream reader specified by contents. More...
 
void setCurrentFrame (int)
 
void setFramesPerSecond (int num)
 
void setViewBox (const QRect &viewbox)
 
void setViewBox (const QRectF &viewbox)
 
QRect viewBox () const
 
QRectF viewBoxF () const
 
 ~QSvgRenderer ()
 Destroys the renderer. More...
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Properties

int currentFrame
 the current frame of the document's animation, or 0 if the document is not animated More...
 
int framesPerSecond
 the number of frames per second to be shown More...
 
QRectF viewBox
 Returns viewBoxF().toRect(). More...
 

Additional Inherited Members

- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.

Since
4.1
Note
This class or function is reentrant.

Using QSvgRenderer, Scalable Vector Graphics (SVG) can be rendered onto any QPaintDevice subclass, including QWidget, QImage, and QGLWidget.

QSvgRenderer 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 QPainter, SVG drawings can be rendered on any subclass of QPaintDevice.

SVG drawings are either loaded when an QSvgRenderer is constructed, or loaded later using the load() 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, isValid() returns true; otherwise it returns false. QSvgRenderer provides the render() slot to render the current document, or the current frame of an animated document, using a given painter.

The defaultSize() 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 QWidget, 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 viewBox property.

Animated SVG drawings are supported, and can be controlled with a simple collection of functions and properties:

The framesPerSecond property contains the rate at which the animation plays.

Finally, the QSvgRenderer class provides the repaintNeeded() signal which is emitted whenever the rendering of the document needs to be updated.

See also
QSvgWidget, {QtSvg Module}, {SVG Viewer Example}, QPicture

Definition at line 64 of file qsvgrenderer.h.

Constructors and Destructors

◆ QSvgRenderer() [1/4]

QSvgRenderer::QSvgRenderer ( QObject parent = 0)

Constructs a new renderer with the given parent.

Definition at line 131 of file qsvgrenderer.cpp.

132  : QObject(*(new QSvgRendererPrivate), parent)
133 {
134 }
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
Definition: qobject.cpp:753

◆ QSvgRenderer() [2/4]

QSvgRenderer::QSvgRenderer ( const QString filename,
QObject parent = 0 
)

Constructs a new renderer with the given parent and loads the contents of the SVG file with the specified filename.

Definition at line 140 of file qsvgrenderer.cpp.

141  : QObject(*new QSvgRendererPrivate, parent)
142 {
143  load(filename);
144 }
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
Definition: qobject.cpp:753
bool load(const QString &filename)
Loads the SVG file specified by filename, returning true if the content was successfully parsed; othe...

◆ QSvgRenderer() [3/4]

QSvgRenderer::QSvgRenderer ( const QByteArray contents,
QObject parent = 0 
)

Constructs a new renderer with the given parent and loads the SVG data from the byte array specified by contents.

Definition at line 150 of file qsvgrenderer.cpp.

151  : QObject(*new QSvgRendererPrivate, parent)
152 {
153  load(contents);
154 }
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
Definition: qobject.cpp:753
bool load(const QString &filename)
Loads the SVG file specified by filename, returning true if the content was successfully parsed; othe...

◆ QSvgRenderer() [4/4]

QSvgRenderer::QSvgRenderer ( QXmlStreamReader contents,
QObject parent = 0 
)

Constructs a new renderer with the given parent and loads the SVG data using the stream reader specified by contents.

Since
4.5

Definition at line 165 of file qsvgrenderer.cpp.

166  : QObject(*new QSvgRendererPrivate, parent)
167 {
168  load(contents);
169 }
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
Definition: qobject.cpp:753
bool load(const QString &filename)
Loads the SVG file specified by filename, returning true if the content was successfully parsed; othe...

◆ ~QSvgRenderer()

QSvgRenderer::~QSvgRenderer ( )

Destroys the renderer.

Definition at line 174 of file qsvgrenderer.cpp.

175 {
176 
177 }

Functions

◆ animated()

bool QSvgRenderer::animated ( ) const

Returns true if the current document contains animated elements; otherwise returns false.

See also
framesPerSecond()

Definition at line 235 of file qsvgrenderer.cpp.

236 {
237  Q_D(const QSvgRenderer);
238  if (d->render)
239  return d->render->animated();
240  else
241  return false;
242 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ animationDuration()

int QSvgRenderer::animationDuration ( ) const

Returns the number of frames in the animation, or 0 if the current document is not animated.

Warning
This function is not part of the public interface.
See also
animated(), framesPerSecond

Definition at line 311 of file qsvgrenderer.cpp.

312 {
313  Q_D(const QSvgRenderer);
314  return d->render->animationDuration();
315 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ boundsOnElement()

QRectF QSvgRenderer::boundsOnElement ( const QString id) const

Returns bounding rectangle of the item with the given id.

Since
4.2

The transformation matrix of parent elements is not affecting the bounds of the element.

See also
matrixForElement()

Definition at line 467 of file qsvgrenderer.cpp.

Referenced by QGraphicsSvgItemPrivate::updateDefaultSize().

468 {
469  Q_D(const QSvgRenderer);
470  QRectF bounds;
471  if (d->render)
472  bounds = d->render->boundsOnElement(id);
473  return bounds;
474 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ currentFrame()

int QSvgRenderer::currentFrame ( ) const

Referenced by setFramesPerSecond().

◆ defaultSize()

QSize QSvgRenderer::defaultSize ( ) const

Returns the default size of the document contents.

Definition at line 191 of file qsvgrenderer.cpp.

Referenced by QSvgIconEngine::pixmap(), and QGraphicsSvgItemPrivate::updateDefaultSize().

192 {
193  Q_D(const QSvgRenderer);
194  if (d->render)
195  return d->render->size();
196  else
197  return QSize();
198 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53

◆ elementExists()

bool QSvgRenderer::elementExists ( const QString id) const

Returns true if the element with the given id exists in the currently parsed SVG file and is a renderable element.

Since
4.2

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. radialGradients even tough marked with "id" attributes will not be found by this method.

Definition at line 493 of file qsvgrenderer.cpp.

494 {
495  Q_D(const QSvgRenderer);
496  bool exists = false;
497  if (d->render)
498  exists = d->render->elementExists(id);
499  return exists;
500 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ framesPerSecond()

int QSvgRenderer::framesPerSecond ( ) const

Referenced by animated().

◆ isValid()

bool QSvgRenderer::isValid ( ) const

Returns true if there is a valid current document; otherwise returns false.

Definition at line 182 of file qsvgrenderer.cpp.

Referenced by QSvgIconEngine::addFile(), and QSvgIconEngine::pixmap().

183 {
184  Q_D(const QSvgRenderer);
185  return d->render;
186 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ load [1/3]

bool QSvgRenderer::load ( const QString filename)
slot

Loads the SVG file specified by filename, returning true if the content was successfully parsed; otherwise returns false.

Definition at line 358 of file qsvgrenderer.cpp.

Referenced by QSvgIOHandlerPrivate::load(), QSvgIconEnginePrivate::loadDataForModeAndState(), and QSvgRenderer().

359 {
360  Q_D(QSvgRenderer);
361  return loadDocument(this, d, filename);
362 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64
static bool loadDocument(QSvgRenderer *const q, QSvgRendererPrivate *const d, const TInputType &in)

◆ load [2/3]

bool QSvgRenderer::load ( const QByteArray contents)
slot

Loads the specified SVG format contents, returning true if the content was successfully parsed; otherwise returns false.

Definition at line 368 of file qsvgrenderer.cpp.

369 {
370  Q_D(QSvgRenderer);
371  return loadDocument(this, d, contents);
372 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64
static bool loadDocument(QSvgRenderer *const q, QSvgRendererPrivate *const d, const TInputType &in)

◆ load [3/3]

bool QSvgRenderer::load ( QXmlStreamReader contents)
slot

Loads the specified SVG in contents, returning true if the content was successfully parsed; otherwise returns false.

The reader will be used from where it currently is positioned. If contents is null, behavior is undefined.

Since
4.5

Definition at line 383 of file qsvgrenderer.cpp.

384 {
385  Q_D(QSvgRenderer);
386  return loadDocument(this, d, contents);
387 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64
static bool loadDocument(QSvgRenderer *const q, QSvgRendererPrivate *const d, const TInputType &in)

◆ matrixForElement()

QMatrix QSvgRenderer::matrixForElement ( const QString id) const

Returns the transformation matrix for the element with the given id.

Since
4.2

The matrix is a product of the transformation of the element's parents. The transformation of the element itself is not included.

To find the bounding rectangle of the element in logical coordinates, you can apply the matrix on the rectangle returned from boundsOnElement().

See also
boundsOnElement()

Definition at line 518 of file qsvgrenderer.cpp.

519 {
520  Q_D(const QSvgRenderer);
521  QMatrix mat;
522  if (d->render)
523  mat = d->render->matrixForElement(id);
524  return mat;
525 }
double d
Definition: qnumeric_p.h:62
The QMatrix class specifies 2D transformations of a coordinate system.
Definition: qmatrix.h:61
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ render [1/3]

void QSvgRenderer::render ( QPainter p)
slot

Renders the current document, or the current frame of an animated document, using the given painter.

Definition at line 393 of file qsvgrenderer.cpp.

Referenced by QSvgIconEngine::pixmap(), and QSvgIOHandler::read().

394 {
395  Q_D(QSvgRenderer);
396  if (d->render) {
397  d->render->draw(painter);
398  }
399 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ render [2/3]

void QSvgRenderer::render ( QPainter painter,
const QRectF bounds 
)
slot

Renders the current document, or the current frame of an animated document, using the given painter on the specified bounds within the painter.

If the bounding rectangle is not specified the SVG file is mapped to the whole paint device.

Definition at line 431 of file qsvgrenderer.cpp.

432 {
433  Q_D(QSvgRenderer);
434  if (d->render) {
435  d->render->draw(painter, bounds);
436  }
437 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ render [3/3]

void QSvgRenderer::render ( QPainter painter,
const QString elementId,
const QRectF bounds = QRectF() 
)
slot

Renders the given element with elementId using the given painter on the specified bounds.

If the bounding rectangle is not specified the SVG element is mapped to the whole paint device.

Definition at line 416 of file qsvgrenderer.cpp.

418 {
419  Q_D(QSvgRenderer);
420  if (d->render) {
421  d->render->draw(painter, elementId, bounds);
422  }
423 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ repaintNeeded

void QSvgRenderer::repaintNeeded ( )
signal

This signal is emitted whenever the rendering of the document needs to be updated, usually for the purposes of animation.

Referenced by QSvgRendererPrivate::callRepaintNeeded(), and loadDocument().

◆ setCurrentFrame()

void QSvgRenderer::setCurrentFrame ( int  frame)
Warning
This function is not part of the public interface.

Definition at line 294 of file qsvgrenderer.cpp.

295 {
296  Q_D(QSvgRenderer);
297  d->render->setCurrentFrame(frame);
298 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ setFramesPerSecond()

void QSvgRenderer::setFramesPerSecond ( int  num)

Definition at line 261 of file qsvgrenderer.cpp.

262 {
263  Q_D(QSvgRenderer);
264  if (num < 0) {
265  qWarning("QSvgRenderer::setFramesPerSecond: Cannot set negative value %d", num);
266  return;
267  }
268  d->fps = num;
269 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
Q_CORE_EXPORT void qWarning(const char *,...)
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ setViewBox() [1/2]

void QSvgRenderer::setViewBox ( const QRect viewbox)

Definition at line 222 of file qsvgrenderer.cpp.

223 {
224  Q_D(QSvgRenderer);
225  if (d->render)
226  d->render->setViewBox(viewbox);
227 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ setViewBox() [2/2]

void QSvgRenderer::setViewBox ( const QRectF viewbox)

Definition at line 448 of file qsvgrenderer.cpp.

449 {
450  Q_D(QSvgRenderer);
451  if (d->render)
452  d->render->setViewBox(viewbox);
453 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64

◆ viewBox()

QRect QSvgRenderer::viewBox ( ) const

Referenced by defaultSize().

◆ viewBoxF()

QRectF QSvgRenderer::viewBoxF ( ) const

Definition at line 439 of file qsvgrenderer.cpp.

440 {
441  Q_D(const QSvgRenderer);
442  if (d->render)
443  return d->render->viewBox();
444  else
445  return QRect();
446 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
Definition: qsvgrenderer.h:64
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

Properties

◆ currentFrame

int QSvgRenderer::currentFrame
private

the current frame of the document's animation, or 0 if the document is not animated

Warning
This function is not part of the public interface.
See also
animationDuration(), framesPerSecond, animated()
Warning
This function is not part of the public interface.

Definition at line 70 of file qsvgrenderer.h.

◆ framesPerSecond

int QSvgRenderer::framesPerSecond
private

the number of frames per second to be shown

The number of frames per second is 0 if the current document is not animated.

See also
animated()

Definition at line 69 of file qsvgrenderer.h.

◆ viewBox

QSvgRenderer::viewBox
private

Returns viewBoxF().toRect().

the rectangle specifying the visible area of the document in logical coordinates

See also
viewBoxF()
Since
4.2

Definition at line 68 of file qsvgrenderer.h.

Referenced by QSvgIOHandlerPrivate::load().


The documentation for this class was generated from the following files: