summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qabstractstate.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-10-30 09:06:17 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-10-30 09:06:17 (GMT)
commitdc4e074324eb91a8a16e14c86ff41b03647b4cfa (patch)
tree55bfad60a6c1ea55d75171596ffd019b0906abb1 /src/corelib/statemachine/qabstractstate.cpp
parent7881773800c05c09f0e85a80c1cbb678981bd6c0 (diff)
parentaf92a4e78613ee3a0d402d3f67126284d0bb6656 (diff)
downloadQt-dc4e074324eb91a8a16e14c86ff41b03647b4cfa.zip
Qt-dc4e074324eb91a8a16e14c86ff41b03647b4cfa.tar.gz
Qt-dc4e074324eb91a8a16e14c86ff41b03647b4cfa.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/corelib/statemachine/qabstractstate.cpp')
-rw-r--r--src/corelib/statemachine/qabstractstate.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/corelib/statemachine/qabstractstate.cpp b/src/corelib/statemachine/qabstractstate.cpp
index 72d640b..cf67cdd 100644
--- a/src/corelib/statemachine/qabstractstate.cpp
+++ b/src/corelib/statemachine/qabstractstate.cpp
@@ -78,7 +78,8 @@ QT_BEGIN_NAMESPACE
function to perform custom processing when the state is exited.
*/
-QAbstractStatePrivate::QAbstractStatePrivate()
+QAbstractStatePrivate::QAbstractStatePrivate()
+ : parentState(0)
{
}
@@ -150,7 +151,10 @@ QAbstractState::~QAbstractState()
*/
QState *QAbstractState::parentState() const
{
- return qobject_cast<QState*>(parent());
+ Q_D(const QAbstractState);
+ if (d->parentState != parent())
+ d->parentState = qobject_cast<QState*>(parent());
+ return d->parentState;
}
/*!