diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-06-17 08:59:50 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-06-17 09:01:59 (GMT) |
commit | 368c3c936fc12ef5249d72ffa5541df3b8558e4d (patch) | |
tree | de8d711c52a67837448b61a3f1b990b841adf0fe /src | |
parent | 4cacc45d10e59bb8915b8d76c359df7a8ad0a846 (diff) | |
download | Qt-368c3c936fc12ef5249d72ffa5541df3b8558e4d.zip Qt-368c3c936fc12ef5249d72ffa5541df3b8558e4d.tar.gz Qt-368c3c936fc12ef5249d72ffa5541df3b8558e4d.tar.bz2 |
bring back QAbstractTransition::triggered() signal
It's been requested by several users. Since we have
QAbstractState::{entered,exited}() signals, we should have this one
as well.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/statemachine/qabstracttransition.cpp | 15 | ||||
-rw-r--r-- | src/corelib/statemachine/qabstracttransition.h | 6 | ||||
-rw-r--r-- | src/corelib/statemachine/qabstracttransition_p.h | 1 | ||||
-rw-r--r-- | src/corelib/statemachine/qstatemachine.cpp | 1 |
4 files changed, 23 insertions, 0 deletions
diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp index 3be3b73..670aa7d 100644 --- a/src/corelib/statemachine/qabstracttransition.cpp +++ b/src/corelib/statemachine/qabstracttransition.cpp @@ -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. @@ -139,6 +141,12 @@ QState *QAbstractTransitionPrivate::sourceState() const return qobject_cast<QState*>(parent); } +void QAbstractTransitionPrivate::emitTriggered() +{ + Q_Q(QAbstractTransition); + emit q->triggered(); +} + /*! Constructs a new QAbstractTransition object with the given \a sourceState. */ @@ -333,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) diff --git a/src/corelib/statemachine/qabstracttransition.h b/src/corelib/statemachine/qabstracttransition.h index 83899ce..9ba1f11 100644 --- a/src/corelib/statemachine/qabstracttransition.h +++ b/src/corelib/statemachine/qabstracttransition.h @@ -89,6 +89,12 @@ public: QList<QAbstractAnimation*> animations() const; #endif +Q_SIGNALS: +#if !defined(Q_MOC_RUN) && !defined(qdoc) +private: // can only be emitted by QAbstractTransition +#endif + void triggered(); + protected: virtual bool eventTest(QEvent *event) = 0; diff --git a/src/corelib/statemachine/qabstracttransition_p.h b/src/corelib/statemachine/qabstracttransition_p.h index f0b9bb3..784832d 100644 --- a/src/corelib/statemachine/qabstracttransition_p.h +++ b/src/corelib/statemachine/qabstracttransition_p.h @@ -78,6 +78,7 @@ public: void callOnTransition(QEvent *e); QState *sourceState() const; QStateMachine *machine() const; + void emitTriggered(); QList<QPointer<QAbstractState> > targetStates; diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 7a34e4b..04cce50 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -498,6 +498,7 @@ void QStateMachinePrivate::executeTransitionContent(QEvent *event, const QList<Q qDebug() << q_func() << ": triggering" << t; #endif QAbstractTransitionPrivate::get(t)->callOnTransition(event); + QAbstractTransitionPrivate::get(t)->emitTriggered(); } } |