summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstate.cpp
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-07-13 19:30:33 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-16 10:08:28 +0200
commitcd1351401ffdfe5e6097b4b41a632655f9fa6e03 (patch)
tree0d9ab87aaa646a04d471751706221d733078b4b2 /src/corelib/statemachine/qstate.cpp
parent0b66f723f06f6d115ea37d4db8bb6c0b5f63885b (diff)
statemachine: Move RestorePolicy enum to QState class
This makes it possible to add API for setting the restore policy per state, or even per property assignment (QTBUG-17861). This change is fully source compatible with Qt4. Change-Id: I53628546b070f6fc84891f86e7ad7bd8ef5ba285 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/corelib/statemachine/qstate.cpp')
-rw-r--r--src/corelib/statemachine/qstate.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index 481f0e92a2..afe0225727 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -124,6 +124,31 @@ QT_BEGIN_NAMESPACE
is entered, all its child states are entered in parallel.
*/
+/*!
+ \enum QState::RestorePolicy
+
+ This enum specifies the restore policy type. The restore policy
+ takes effect when the machine enters a state which sets one or more
+ properties. If the restore policy is set to RestoreProperties,
+ the state machine will save the original value of the property before the
+ new value is set.
+
+ Later, when the machine either enters a state which does not set
+ a value for the given property, the property will automatically be restored
+ to its initial value.
+
+ Only one initial value will be saved for any given property. If a value for a property has
+ already been saved by the state machine, it will not be overwritten until the property has been
+ successfully restored.
+
+ \value DontRestoreProperties The state machine should not save the initial values of properties
+ and restore them later.
+ \value RestoreProperties The state machine should save the initial values of properties
+ and restore them later.
+
+ \sa QStateMachine::globalRestorePolicy, QState::assignProperty()
+*/
+
QStatePrivate::QStatePrivate()
: QAbstractStatePrivate(StandardState),
errorState(0), initialState(0), childMode(QState::ExclusiveStates),