diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-11-19 05:29:51 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-11-19 05:29:51 (GMT) |
commit | 0276466cac5a367f9337062d6d524b493e51ff0f (patch) | |
tree | 9d87f61500b84f162ecc2c4ce26cefab838f80b1 /src/declarative | |
parent | 3e52973f552391a5159b27d6252a81f6a1d52d8c (diff) | |
parent | 1c0d43cf8f2543be89ba02e659b8fd7e975f7f96 (diff) | |
download | Qt-0276466cac5a367f9337062d6d524b493e51ff0f.zip Qt-0276466cac5a367f9337062d6d524b493e51ff0f.tar.gz Qt-0276466cac5a367f9337062d6d524b493e51ff0f.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp | 10 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsflickable.cpp | 12 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsflickable_p.h | 3 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsgridview.cpp | 21 | ||||
-rw-r--r-- | src/declarative/util/qmlstate.cpp | 3 | ||||
-rw-r--r-- | src/declarative/util/qmlstategroup.cpp | 9 | ||||
-rw-r--r-- | src/declarative/util/qmlstategroup_p.h | 1 |
7 files changed, 34 insertions, 25 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp b/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp index 97fdc6a..f389295 100644 --- a/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp @@ -209,7 +209,7 @@ void QmlGraphicsAnimatedImage::setSource(const QUrl &url) //### should be unified with movieRequestFinished d->_movie = new QMovie(lf); if (!d->_movie->isValid()){ - qWarning() << "Error Reading Animated Image File " << d->url; + qWarning() << "Error Reading Animated Image File" << d->url; delete d->_movie; d->_movie = 0; return; @@ -261,7 +261,7 @@ void QmlGraphicsAnimatedImage::movieRequestFinished() d->_movie->setCacheMode(QMovie::CacheAll); if(d->playing) d->_movie->start(); - else { + if (d->paused || !d->playing) { d->_movie->jumpToFrame(d->preset_currentframe); d->preset_currentframe = 0; } @@ -293,8 +293,10 @@ void QmlGraphicsAnimatedImage::playingStatusChanged() void QmlGraphicsAnimatedImage::componentComplete() { Q_D(QmlGraphicsAnimatedImage); - setCurrentFrame(d->preset_currentframe); - d->preset_currentframe = 0; + if (!d->reply) { + setCurrentFrame(d->preset_currentframe); + d->preset_currentframe = 0; + } } QT_END_NAMESPACE diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp index ea9c173..b3a34ed 100644 --- a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp @@ -568,18 +568,6 @@ QmlGraphicsItem *QmlGraphicsFlickable::viewport() return d->viewport; } -qreal QmlGraphicsFlickable::visibleX() const -{ - Q_D(const QmlGraphicsFlickable); - return -d->_moveX.value(); -} - -qreal QmlGraphicsFlickable::visibleY() const -{ - Q_D(const QmlGraphicsFlickable); - return -d->_moveY.value(); -} - QmlGraphicsFlickableVisibleArea *QmlGraphicsFlickable::visibleArea() { Q_D(QmlGraphicsFlickable); diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable_p.h b/src/declarative/graphicsitems/qmlgraphicsflickable_p.h index 10447f6..50248e1 100644 --- a/src/declarative/graphicsitems/qmlgraphicsflickable_p.h +++ b/src/declarative/graphicsitems/qmlgraphicsflickable_p.h @@ -159,9 +159,6 @@ protected: void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void timerEvent(QTimerEvent *event); - qreal visibleX() const; - qreal visibleY() const; - QmlGraphicsFlickableVisibleArea *visibleArea(); protected Q_SLOTS: diff --git a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp index 473f9e5..7e2d983 100644 --- a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp @@ -1302,12 +1302,21 @@ void QmlGraphicsGridView::trackedPositionChanged() if (!d->trackedItem) return; if (!isFlicking() && !d->moving && d->moveReason != QmlGraphicsGridViewPrivate::Mouse) { - if (d->trackedItem->rowPos() < d->position()) { - d->setPosition(d->trackedItem->rowPos()); - } else if (d->trackedItem->endRowPos() > d->position() + d->size()) { - qreal pos = d->trackedItem->endRowPos() - d->size(); - if (d->rowSize() > d->size()) - pos = d->trackedItem->rowPos(); + const qreal viewPos = d->position(); + if (d->trackedItem->rowPos() < viewPos && d->currentItem->rowPos() < viewPos) { + d->setPosition(d->currentItem->rowPos() < d->trackedItem->rowPos() ? d->trackedItem->rowPos() : d->currentItem->rowPos()); + } else if (d->trackedItem->endRowPos() > viewPos + d->size() + && d->currentItem->endRowPos() > viewPos + d->size()) { + qreal pos; + if (d->trackedItem->endRowPos() < d->currentItem->endRowPos()) { + pos = d->trackedItem->endRowPos() - d->size(); + if (d->rowSize() > d->size()) + pos = d->trackedItem->rowPos(); + } else { + pos = d->currentItem->endRowPos() - d->size(); + if (d->rowSize() > d->size()) + pos = d->currentItem->rowPos(); + } d->setPosition(pos); } } diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp index c05c539..5fde89a 100644 --- a/src/declarative/util/qmlstate.cpp +++ b/src/declarative/util/qmlstate.cpp @@ -161,6 +161,9 @@ QmlState::QmlState(QObject *parent) QmlState::~QmlState() { + Q_D(QmlState); + if (d->group) + d->group->removeState(this); } /*! diff --git a/src/declarative/util/qmlstategroup.cpp b/src/declarative/util/qmlstategroup.cpp index 506ab82..d6ce191 100644 --- a/src/declarative/util/qmlstategroup.cpp +++ b/src/declarative/util/qmlstategroup.cpp @@ -119,6 +119,9 @@ QmlStateGroup::QmlStateGroup(QObject *parent) QmlStateGroup::~QmlStateGroup() { + Q_D(const QmlStateGroup); + for (int i = 0; i < d->states.count(); ++i) + d->states.at(i)->setStateGroup(0); } QList<QmlState *> QmlStateGroup::states() const @@ -380,4 +383,10 @@ QmlState *QmlStateGroup::findState(const QString &name) const return 0; } +void QmlStateGroup::removeState(QmlState *state) +{ + Q_D(QmlStateGroup); + d->states.removeOne(state); +} + QT_END_NAMESPACE diff --git a/src/declarative/util/qmlstategroup_p.h b/src/declarative/util/qmlstategroup_p.h index f4c6d86..ddd27d7 100644 --- a/src/declarative/util/qmlstategroup_p.h +++ b/src/declarative/util/qmlstategroup_p.h @@ -83,6 +83,7 @@ Q_SIGNALS: private: friend class QmlState; void updateAutoState(); + void removeState(QmlState *state); }; QT_END_NAMESPACE |