42 #include "private/qdeclarativeanimatedimage_p.h" 43 #include "private/qdeclarativeanimatedimage_p_p.h" 48 #include <private/qdeclarativeengine_p.h> 51 #include <QNetworkRequest> 52 #include <QNetworkReply> 181 if(pause ==
d->paused)
186 d->_movie->setPaused(pause);
209 if(play ==
d->playing)
234 return d->preset_currentframe;
235 return d->_movie->currentFrameNumber();
242 d->preset_currentframe = frame;
245 d->_movie->jumpToFrame(frame);
253 return d->_movie->frameCount();
266 d->reply->deleteLater();
282 qreal oldProgress =
d->progress;
284 if (
d->url.isEmpty()) {
289 if (
d->status != oldStatus)
291 if (
d->progress != oldProgress)
294 #ifndef QT_NO_LOCALFILE_OPTIMIZED_QML 299 if (!
d->_movie->isValid()){
300 qmlInfo(
this) <<
"Error Reading Animated Image File " <<
d->url.toString();
304 if (
d->status != oldStatus)
316 d->_movie->jumpToFrame(0);
318 d->_movie->setPaused(
true);
319 d->setPixmap(
d->_movie->currentPixmap());
322 if (
d->status != oldStatus)
324 if (
d->progress != oldProgress)
343 #define ANIMATEDIMAGE_MAXIMUM_REDIRECT_RECURSION 16 353 QUrl url =
d->reply->url().resolved(redirect.
toUrl());
354 d->reply->deleteLater();
363 if (!
d->_movie->isValid()){
364 #ifndef QT_NO_DEBUG_STREAM 365 qmlInfo(
this) <<
"Error Reading Animated Image File " <<
d->url;
380 if (
d->paused || !
d->playing) {
381 d->_movie->jumpToFrame(
d->preset_currentframe);
382 d->preset_currentframe = 0;
385 d->_movie->setPaused(
true);
386 d->setPixmap(
d->_movie->currentPixmap());
394 d->setPixmap(
d->_movie->currentPixmap());
415 if (
d->url.isValid())
419 d->preset_currentframe = 0;
425 #endif // QT_NO_MOVIE The QVariant class acts like a union for the most common Qt data types.
static QString urlToLocalFileOrQrc(const QUrl &url)
virtual void setSource(const QUrl &)
#define QT_END_NAMESPACE
This macro expands to.
QDeclarativeAnimatedImage(QDeclarativeItem *parent=0)
The QMovie class is a convenience class for playing movies with QImageReader.
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define ANIMATEDIMAGE_MAXIMUM_REDIRECT_RECURSION
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
void setAttribute(Attribute code, const QVariant &value)
Sets the attribute associated with code code to be value value.
void statusChanged(QDeclarativeImageBase::Status)
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QDeclarativeItem class provides the most basic of all visual items in QML.
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 isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void playingStatusChanged()
void sourceChanged(const QUrl &)
QNetworkReply * get(const QNetworkRequest &request)
Posts a request to obtain the contents of the target request and returns a new QNetworkReply object o...
QUrl toUrl() const
Returns the variant as a QUrl if the variant has type() Url ; otherwise returns an invalid QUrl...
void movieRequestFinished()
MovieState
This enum describes the different states of QMovie.
void progressChanged(qreal progress)
Q_DECLARATIVE_EXPORT QDeclarativeEngine * qmlEngine(const QObject *)
void setCurrentFrame(int frame)
void setPaused(bool pause)
virtual void componentComplete()
void setPlaying(bool play)
The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
The QPixmap class is an off-screen image representation that can be used as a paint device...
QDeclarativeInfo qmlInfo(const QObject *me)
QNetworkAccessManager * networkAccessManager() const
Returns a common QNetworkAccessManager which can be used by any QML element instantiated by this engi...
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
~QDeclarativeAnimatedImage()
void requestProgress(qint64, qint64)
void stateChanged(const QString &)