diff options
-rw-r--r-- | src/declarative/util/qmlstate.cpp | 3 | ||||
-rw-r--r-- | src/declarative/util/qmlstate.h | 1 | ||||
-rw-r--r-- | src/declarative/util/qmlstateoperations.cpp | 8 | ||||
-rw-r--r-- | src/declarative/util/qmlstateoperations.h | 1 |
4 files changed, 12 insertions, 1 deletions
diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp index 508ef43..da7d429 100644 --- a/src/declarative/util/qmlstate.cpp +++ b/src/declarative/util/qmlstate.cpp @@ -359,6 +359,9 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever } } } + if (!found) + action.event->saveForwardBindings(); + //### do we ever need to do saveForwardBindings when found == true? } else { action.fromBinding = action.property.binding(); diff --git a/src/declarative/util/qmlstate.h b/src/declarative/util/qmlstate.h index 0b48449..255051f 100644 --- a/src/declarative/util/qmlstate.h +++ b/src/declarative/util/qmlstate.h @@ -95,6 +95,7 @@ public: virtual QList<Action> extraActions(); virtual bool changesBindings(); + virtual void saveForwardBindings() {} virtual void clearForwardBindings(); virtual void clearReverseBindings(); virtual bool override(ActionEvent*other); diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp index 858a527..2ba6619 100644 --- a/src/declarative/util/qmlstateoperations.cpp +++ b/src/declarative/util/qmlstateoperations.cpp @@ -498,13 +498,19 @@ bool QmlAnchorChanges::changesBindings() return true; } -void QmlAnchorChanges::clearForwardBindings() +void QmlAnchorChanges::saveForwardBindings() { Q_D(QmlAnchorChanges); d->origLeft = d->target->anchors()->left(); d->origRight = d->target->anchors()->right(); d->origTop = d->target->anchors()->top(); d->origBottom = d->target->anchors()->bottom(); + +} + +void QmlAnchorChanges::clearForwardBindings() +{ + Q_D(QmlAnchorChanges); d->origX = d->target->x(); d->origY = d->target->y(); d->origWidth = d->target->width(); diff --git a/src/declarative/util/qmlstateoperations.h b/src/declarative/util/qmlstateoperations.h index afe0bd5..b2a37a6 100644 --- a/src/declarative/util/qmlstateoperations.h +++ b/src/declarative/util/qmlstateoperations.h @@ -147,6 +147,7 @@ public: virtual bool override(ActionEvent*other); virtual QList<Action> extraActions(); virtual bool changesBindings(); + virtual void saveForwardBindings(); virtual void clearForwardBindings(); virtual void clearReverseBindings(); }; |