summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstate.cpp
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-10-29 14:28:02 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-10-30 09:12:58 (GMT)
commit83fff2f970b9a7b41861336c7dca0eadbda28099 (patch)
treeacbd743e52fe10c281755fb07e769732ce56f696 /src/corelib/statemachine/qstate.cpp
parentdc4e074324eb91a8a16e14c86ff41b03647b4cfa (diff)
downloadQt-83fff2f970b9a7b41861336c7dca0eadbda28099.zip
Qt-83fff2f970b9a7b41861336c7dca0eadbda28099.tar.gz
Qt-83fff2f970b9a7b41861336c7dca0eadbda28099.tar.bz2
Introduce internal StateType to avoid excessive qobject_casts
The state machine algorithm frequently needs to know what type a state is, e.g. if it is atomic, final or a history state. We were using qobject_cast() to determine this, but that function is expensive. This commit introduces an internal StateType to be able to differentiate between the different types of state. This vastly improves performance. Reviewed-by: Eskil Abrahamsen Blomfeldt
Diffstat (limited to 'src/corelib/statemachine/qstate.cpp')
-rw-r--r--src/corelib/statemachine/qstate.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index bcd8364..5dc310b 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -124,7 +124,8 @@ QT_BEGIN_NAMESPACE
*/
QStatePrivate::QStatePrivate()
- : errorState(0), initialState(0), childMode(QState::ExclusiveStates),
+ : QAbstractStatePrivate(StandardState),
+ errorState(0), initialState(0), childMode(QState::ExclusiveStates),
childStatesListNeedsRefresh(true), transitionsListNeedsRefresh(true)
{
}