summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-04 08:10:08 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-04 08:10:08 (GMT)
commitcb48b1bd67e094446cf73d8a0940d25dc8334708 (patch)
treea0f18723898f4e9d8cfc65fb386d5fd30c974f81 /src/declarative
parent38bffdd9a5dc648d9f2c75b0be5648e938a930c6 (diff)
downloadQt-cb48b1bd67e094446cf73d8a0940d25dc8334708.zip
Qt-cb48b1bd67e094446cf73d8a0940d25dc8334708.tar.gz
Qt-cb48b1bd67e094446cf73d8a0940d25dc8334708.tar.bz2
Remove property-order sensitivity.
Fixes autotest.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/extra/qmlgraphicsanimatedimageitem.cpp19
-rw-r--r--src/declarative/extra/qmlgraphicsanimatedimageitem_p.h1
-rw-r--r--src/declarative/extra/qmlgraphicsanimatedimageitem_p_p.h3
3 files changed, 18 insertions, 5 deletions
diff --git a/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp b/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp
index f3c2058..ba09279 100644
--- a/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp
+++ b/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp
@@ -158,15 +158,17 @@ int QmlGraphicsAnimatedImageItem::currentFrame() const
{
Q_D(const QmlGraphicsAnimatedImageItem);
if (!d->_movie)
- return -1;
+ return d->preset_currentframe;
return d->_movie->currentFrameNumber();
}
void QmlGraphicsAnimatedImageItem::setCurrentFrame(int frame)
{
Q_D(QmlGraphicsAnimatedImageItem);
- if (!d->_movie)
+ if (!d->_movie) {
+ d->preset_currentframe = frame;
return;
+ }
d->_movie->jumpToFrame(frame);
}
@@ -264,8 +266,10 @@ void QmlGraphicsAnimatedImageItem::movieRequestFinished()
d->_movie->setCacheMode(QMovie::CacheAll);
if(d->playing)
d->_movie->start();
- else
- d->_movie->jumpToFrame(0);
+ else {
+ d->_movie->jumpToFrame(d->preset_currentframe);
+ d->preset_currentframe = 0;
+ }
if(d->paused)
d->_movie->setPaused(true);
d->setPixmap(d->_movie->currentPixmap());
@@ -291,4 +295,11 @@ void QmlGraphicsAnimatedImageItem::playingStatusChanged()
}
}
+void QmlGraphicsAnimatedImageItem::componentComplete()
+{
+ Q_D(QmlGraphicsAnimatedImageItem);
+ setCurrentFrame(d->preset_currentframe);
+ d->preset_currentframe = 0;
+}
+
QT_END_NAMESPACE
diff --git a/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h b/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h
index 097aecd..b581ea3 100644
--- a/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h
+++ b/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h
@@ -91,6 +91,7 @@ private Q_SLOTS:
protected:
QmlGraphicsAnimatedImageItem(QmlGraphicsAnimatedImageItemPrivate &dd, QmlGraphicsItem *parent);
+ void componentComplete();
private:
Q_DISABLE_COPY(QmlGraphicsAnimatedImageItem)
diff --git a/src/declarative/extra/qmlgraphicsanimatedimageitem_p_p.h b/src/declarative/extra/qmlgraphicsanimatedimageitem_p_p.h
index 0b12d2f..2256b9b 100644
--- a/src/declarative/extra/qmlgraphicsanimatedimageitem_p_p.h
+++ b/src/declarative/extra/qmlgraphicsanimatedimageitem_p_p.h
@@ -66,12 +66,13 @@ class QmlGraphicsAnimatedImageItemPrivate : public QmlGraphicsImagePrivate
public:
QmlGraphicsAnimatedImageItemPrivate()
- : playing(true), paused(false), _movie(0), reply(0)
+ : playing(true), paused(false), preset_currentframe(0), _movie(0), reply(0)
{
}
bool playing;
bool paused;
+ int preset_currentframe;
QMovie *_movie;
QNetworkReply *reply;
};