summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qabstracttransition.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/statemachine/qabstracttransition.cpp')
-rw-r--r--src/corelib/statemachine/qabstracttransition.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp
index f582b8c..670aa7d 100644
--- a/src/corelib/statemachine/qabstracttransition.cpp
+++ b/src/corelib/statemachine/qabstracttransition.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtCore module of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -67,6 +67,8 @@ QT_BEGIN_NAMESPACE
targetStates() function returns the targets of the transition. The machine()
function returns the state machine that the transition is part of.
+ The triggered() signal is emitted when the transition has been triggered.
+
Transitions can cause animations to be played. Use the addAnimation()
function to add an animation to the transition.
@@ -113,8 +115,7 @@ QAbstractTransitionPrivate *QAbstractTransitionPrivate::get(QAbstractTransition
QStateMachine *QAbstractTransitionPrivate::machine() const
{
- Q_Q(const QAbstractTransition);
- QObject *par = q->parent();
+ QObject *par = parent;
while (par != 0) {
if (QStateMachine *mach = qobject_cast<QStateMachine*>(par))
return mach;
@@ -137,8 +138,13 @@ void QAbstractTransitionPrivate::callOnTransition(QEvent *e)
QState *QAbstractTransitionPrivate::sourceState() const
{
- Q_Q(const QAbstractTransition);
- return qobject_cast<QState*>(q->parent());
+ return qobject_cast<QState*>(parent);
+}
+
+void QAbstractTransitionPrivate::emitTriggered()
+{
+ Q_Q(QAbstractTransition);
+ emit q->triggered();
}
/*!
@@ -335,6 +341,13 @@ QList<QAbstractAnimation*> QAbstractTransition::animations() const
*/
/*!
+ \fn QAbstractTransition::triggered()
+
+ This signal is emitted when the transition has been triggered (after
+ onTransition() has been called).
+*/
+
+/*!
\reimp
*/
bool QAbstractTransition::event(QEvent *e)