summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstatemachine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/statemachine/qstatemachine.cpp')
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 81d65d5..0ebc993 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -658,13 +658,16 @@ void QStateMachinePrivate::applyProperties(const QList<QAbstractTransition*> &tr
}
// Remove pending restorables for all parent states to avoid restoring properties
- // before the state that assigned them is exited.
+ // before the state that assigned them is exited. If state does not explicitly
+ // assign a property which is assigned by the parent, it inherits the parent's assignment.
QState *parentState = s;
while (parentState = parentState->parentState()) {
assignments = QStatePrivate::get(parentState)->propertyAssignments;
for (int j=0; j<assignments.size(); ++j) {
const QPropertyAssignment &assn = assignments.at(j);
- pendingRestorables.remove(RestorableId(assn.object, assn.propertyName));
+ int c = pendingRestorables.remove(RestorableId(assn.object, assn.propertyName));
+ if (c > 0)
+ propertyAssignmentsForState[s].append(assn);
}
}
}