44 #ifndef QT_NO_SVGRENDERER 51 #include "private/qobject_p.h" 195 return d->render->size();
209 return d->render->viewBox().toRect();
226 d->render->setViewBox(viewbox);
239 return d->render->animated();
265 qWarning(
"QSvgRenderer::setFramesPerSecond: Cannot set negative value %d", num);
288 return d->render->currentFrame();
297 d->render->setCurrentFrame(frame);
314 return d->render->animationDuration();
329 template<
typename TInputType>
332 const TInputType &in)
344 }
else if (d->
timer) {
397 d->render->draw(painter);
421 d->render->draw(painter, elementId, bounds);
435 d->render->draw(painter, bounds);
443 return d->render->viewBox();
452 d->render->setViewBox(viewbox);
472 bounds =
d->render->boundsOnElement(
id);
498 exists =
d->render->elementExists(
id);
523 mat =
d->render->matrixForElement(
id);
529 #include "moc_qsvgrenderer.cpp" 531 #endif // QT_NO_SVGRENDERER The QPainter class performs low-level painting on widgets and other paint devices.
#define QT_END_NAMESPACE
This macro expands to.
The QMatrix class specifies 2D transformations of a coordinate system.
QSvgTinyDocument * render
The QByteArray class provides an array of bytes.
int framesPerSecond() const
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
static void callRepaintNeeded(QSvgRenderer *const q)
bool animated() const
Returns true if the current document contains animated elements; otherwise returns false...
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
int animationDuration() const
Returns the number of frames in the animation, or 0 if the current document is not animated...
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 rece...
bool isValid() const
Returns true if there is a valid current document; otherwise returns false.
void setCurrentFrame(int)
Q_CORE_EXPORT void qWarning(const char *,...)
QSize defaultSize() const
Returns the default size of the document contents.
void setViewBox(const QRect &viewbox)
#define Q_DECLARE_PUBLIC(Class)
The QSvgRenderer class is used to draw the contents of SVG files onto paint devices.
static bool loadDocument(QSvgRenderer *const q, QSvgRendererPrivate *const d, const TInputType &in)
void setFramesPerSecond(int num)
QMatrix matrixForElement(const QString &id) const
Returns the transformation matrix for the element with the given id.
QSvgRenderer(QObject *parent=0)
Constructs a new renderer with the given parent.
void repaintNeeded()
This signal is emitted whenever the rendering of the document needs to be updated, usually for the purposes of animation.
QObject * parent() const
Returns a pointer to the parent object.
void render(QPainter *p)
Renders the current document, or the current frame of an animated document, using the given painter...
~QSvgRenderer()
Destroys the renderer.
bool load(const QString &filename)
Loads the SVG file specified by filename, returning true if the content was successfully parsed; othe...
The QRect class defines a rectangle in the plane using integer precision.
The QSize class defines the size of a two-dimensional object using integer point precision.
The QXmlStreamReader class provides a fast parser for reading well-formed XML via a simple streaming ...
The QTimer class provides repetitive and single-shot timers.
void stop()
Stops the timer.
static QSvgTinyDocument * load(const QString &file)
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
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 render...
QRectF boundsOnElement(const QString &id) const
Returns bounding rectangle of the item with the given id.