summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qmltransition.cpp
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-02-23 15:23:05 (GMT)
committeraxis <qt-info@nokia.com>2010-02-23 15:23:05 (GMT)
commitf67062af3a076468442c29127cb48bb13937ce0e (patch)
treea12cd4c644fb528dd5f95cb58559732a0b8b6311 /src/declarative/util/qmltransition.cpp
parenta670009fd378d48ff891602ec31204614e8a476f (diff)
parentc15307e9e916aa613096275919ca91deba64454f (diff)
downloadQt-f67062af3a076468442c29127cb48bb13937ce0e.zip
Qt-f67062af3a076468442c29127cb48bb13937ce0e.tar.gz
Qt-f67062af3a076468442c29127cb48bb13937ce0e.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-s60-public
Conflicts: mkspecs/features/symbian/qt.prf qmake/Makefile.unix qmake/Makefile.win32 qmake/Makefile.win32-g++ qmake/Makefile.win32-g++-sh qmake/generators/symbian/initprojectdeploy_symbian.cpp src/src.pro
Diffstat (limited to 'src/declarative/util/qmltransition.cpp')
-rw-r--r--src/declarative/util/qmltransition.cpp39
1 files changed, 13 insertions, 26 deletions
diff --git a/src/declarative/util/qmltransition.cpp b/src/declarative/util/qmltransition.cpp
index 22826ce..e90fc20 100644
--- a/src/declarative/util/qmltransition.cpp
+++ b/src/declarative/util/qmltransition.cpp
@@ -82,10 +82,11 @@ class QmlTransitionPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QmlTransition)
public:
- QmlTransitionPrivate() : fromState(QLatin1String("*")), toState(QLatin1String("*"))
- , reversed(false), reversible(false), endState(0)
+ QmlTransitionPrivate()
+ : fromState(QLatin1String("*")), toState(QLatin1String("*")),
+ reversed(false), reversible(false), endState(0)
{
- animations.parent = this;
+ group.trans = this;
}
QString fromState;
@@ -95,32 +96,20 @@ public:
ParallelAnimationWrapper group;
QmlTransitionManager *endState;
- void init()
- {
- group.trans = this;
- }
-
void complete()
{
endState->complete();
}
-
- class AnimationList : public QmlConcreteList<QmlAbstractAnimation *>
- {
- public:
- AnimationList() : parent(0) {}
- virtual void append(QmlAbstractAnimation *a);
- virtual void clear() { QmlConcreteList<QmlAbstractAnimation *>::clear(); } //###
-
- QmlTransitionPrivate *parent;
- };
- AnimationList animations;
+ static void append_animation(QmlListProperty<QmlAbstractAnimation> *list, QmlAbstractAnimation *a);
+ QList<QmlAbstractAnimation *> animations;
};
-void QmlTransitionPrivate::AnimationList::append(QmlAbstractAnimation *a)
+void QmlTransitionPrivate::append_animation(QmlListProperty<QmlAbstractAnimation> *list, QmlAbstractAnimation *a)
{
- QmlConcreteList<QmlAbstractAnimation *>::append(a);
- parent->group.addAnimation(a->qtAnimation());
+ QmlTransition *q = static_cast<QmlTransition *>(list->object);
+ q->d_func()->animations.append(a);
+ q->d_func()->group.addAnimation(a->qtAnimation());
+ a->setDisableUserControl();
}
void ParallelAnimationWrapper::updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
@@ -139,8 +128,6 @@ QML_DEFINE_TYPE(Qt,4,6,Transition,QmlTransition)
QmlTransition::QmlTransition(QObject *parent)
: QObject(*(new QmlTransitionPrivate), parent)
{
- Q_D(QmlTransition);
- d->init();
}
QmlTransition::~QmlTransition()
@@ -250,10 +237,10 @@ void QmlTransition::setToState(const QString &t)
and assign that to animations the animations property.
\default
*/
-QmlList<QmlAbstractAnimation *>* QmlTransition::animations()
+QmlListProperty<QmlAbstractAnimation> QmlTransition::animations()
{
Q_D(QmlTransition);
- return &d->animations;
+ return QmlListProperty<QmlAbstractAnimation>(this, &d->animations, QmlTransitionPrivate::append_animation);
}
QT_END_NAMESPACE