Qt 4.8
Classes | Functions
qsvgrenderer.cpp File Reference
#include "qsvgrenderer.h"
#include "qsvgtinydocument_p.h"
#include "qbytearray.h"
#include "qtimer.h"
#include "qdebug.h"
#include "private/qobject_p.h"
#include "moc_qsvgrenderer.cpp"

Go to the source code of this file.

Classes

class  QSvgRendererPrivate
 

Functions

template<typename TInputType >
static bool loadDocument (QSvgRenderer *const q, QSvgRendererPrivate *const d, const TInputType &in)
 

Function Documentation

◆ loadDocument()

template<typename TInputType >
static bool loadDocument ( QSvgRenderer *const  q,
QSvgRendererPrivate *const  d,
const TInputType &  in 
)
static

Definition at line 330 of file qsvgrenderer.cpp.

Referenced by QSvgRenderer::load().

333 {
334  delete d->render;
336  if (d->render && d->render->animated() && d->fps > 0) {
337  if (!d->timer)
338  d->timer = new QTimer(q);
339  else
340  d->timer->stop();
341  q->connect(d->timer, SIGNAL(timeout()),
342  q, SIGNAL(repaintNeeded()));
343  d->timer->start(1000/d->fps);
344  } else if (d->timer) {
345  d->timer->stop();
346  }
347 
348  //force first update
350 
351  return d->render;
352 }
QSvgTinyDocument * render
static void callRepaintNeeded(QSvgRenderer *const q)
#define SIGNAL(a)
Definition: qobjectdefs.h:227
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...
Definition: qobject.cpp:2580
The QTimer class provides repetitive and single-shot timers.
Definition: qtimer.h:56
void stop()
Stops the timer.
Definition: qtimer.cpp:284
static QSvgTinyDocument * load(const QString &file)
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
Definition: qtimer.cpp:249