diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-11-19 04:56:10 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-11-19 04:56:10 (GMT) |
commit | ef3f0a80c3862f3d7c423fc82a84477d0c96fd08 (patch) | |
tree | bad017f3b69422cbb4e256871e340fd6811d1d01 | |
parent | 6438ecfd5026dc294c91a2efdc0ac84cdaddf8b5 (diff) | |
parent | ea44f6e9b6935c2dbd7fd17c95ffcbb08347c1a0 (diff) | |
download | Qt-ef3f0a80c3862f3d7c423fc82a84477d0c96fd08.zip Qt-ef3f0a80c3862f3d7c423fc82a84477d0c96fd08.tar.gz Qt-ef3f0a80c3862f3d7c423fc82a84477d0c96fd08.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-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 |
3 files changed, 13 insertions, 0 deletions
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 |