6#ifndef QT_NO_SVGRENDERER
14#include "private/qobject_p.h"
108 static bool envOk =
false;
109 static QtSvg::Options envOpts = QtSvg::Options::fromInt(
188 return d->render->size();
202 return d->render->viewBox().toRect();
216 d->render->setViewBox(viewbox);
229 return d->render->animated();
252 return d->animationEnabled;
259 d->startOrStopTimer();
280 qWarning(
"QSvgRenderer::setFramesPerSecond: Cannot set negative value %d",
num);
284 d->startOrStopTimer();
306 if (
d->render &&
d->render->preserveAspectRatio())
316 d->render->setPreserveAspectRatio(
true);
318 d->render->setPreserveAspectRatio(
false);
372 return d->render->currentFrame();
381 d->render->setCurrentFrame(
frame);
395 return d->render->animationDuration();
407 emit q->repaintNeeded();
410template<
typename TInputType>
413 const TInputType &
in)
417 if (
d->render && !
d->render->size().isValid()) {
421 d->startOrStopTimer();
493 d->render->draw(
painter, elementId, bounds);
515 return d->render->viewBox();
524 d->render->setViewBox(viewbox);
541 bounds =
d->render->boundsOnElement(
id);
564 exists =
d->render->elementExists(
id);
586 trans =
d->render->transformForElement(
id);
592#include "moc_qsvgrenderer.cpp"
The QPainter class performs low-level painting on widgets and other paint devices.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
QSvgTinyDocument * render
static QtSvg::Options defaultOptions()
static QtSvg::Options appDefaultOptions
void ensureTimerCreated()
static void callRepaintNeeded(QSvgRenderer *const q)
QTransform transformForElement(const QString &id) const
void setOptions(QtSvg::Options flags)
void render(QPainter *p)
Renders the current document, or the current frame of an animated document, using the given painter.
QRectF boundsOnElement(const QString &id) const
QSize defaultSize() const
Returns the default size of the document contents.
bool animated() const
Returns true if the current document contains animated elements; otherwise returns false.
static void setDefaultOptions(QtSvg::Options flags)
Sets the option flags that renderers will be created with to flags.
~QSvgRenderer()
Destroys the renderer.
bool isValid() const
Returns true if there is a valid current document; otherwise returns false.
QSvgRenderer(QObject *parent=nullptr)
Constructs a new renderer with the given parent.
int currentFrame
the current frame of the document's animation, or 0 if the document is not animated
void setFramesPerSecond(int num)
int framesPerSecond
the number of frames per second to be shown
void setAspectRatioMode(Qt::AspectRatioMode mode)
Qt::AspectRatioMode aspectRatioMode
how rendering adheres to the SVG view box aspect ratio
void setViewBox(const QRect &viewbox)
bool load(const QString &filename)
Loads the SVG file specified by filename, returning true if the content was successfully parsed; othe...
int animationDuration() const
bool elementExists(const QString &id) const
bool isAnimationEnabled() const
void setCurrentFrame(int)
void repaintNeeded()
This signal is emitted whenever the rendering of the document needs to be updated,...
QRectF viewBox
the rectangle specifying the visible area of the document in logical coordinates
void setAnimationEnabled(bool enable)
static QSvgTinyDocument * load(const QString &file, QtSvg::Options options={})
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
void stop()
Stops the timer.
void timeout(QPrivateSignal)
This signal is emitted when the timer times out.
Combined button and popup list for selecting options.
GLdouble GLdouble GLdouble GLdouble q
static bool loadDocument(QSvgRenderer *const q, QSvgRendererPrivate *const d, const TInputType &in)
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept