diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp index f1f4786bcc..259aaf52e9 100644 --- a/src/corelib/statemachine/qsignaltransition.cpp +++ b/src/corelib/statemachine/qsignaltransition.cpp @@ -185,6 +185,7 @@ void QSignalTransition::setSenderObject(const QObject *sender) d->unregister(); d->sender = sender; d->maybeRegister(); + emit senderObjectChanged(QPrivateSignal()); } /*! @@ -207,6 +208,7 @@ void QSignalTransition::setSignal(const QByteArray &signal) d->unregister(); d->signal = signal; d->maybeRegister(); + emit signalChanged(QPrivateSignal()); } /*! @@ -245,6 +247,24 @@ bool QSignalTransition::event(QEvent *e) return QAbstractTransition::event(e); } +/*! + \fn QSignalTransition::senderObjectChanged() + \since 5.4 + + This signal is emitted when the senderObject property is changed. + + \sa QSignalTransition::senderObject +*/ + +/*! + \fn QSignalTransition::signalChanged() + \since 5.4 + + This signal is emitted when the signal property is changed. + + \sa QSignalTransition::signal +*/ + void QSignalTransitionPrivate::callOnTransition(QEvent *e) { Q_Q(QSignalTransition); @@ -260,6 +280,7 @@ void QSignalTransitionPrivate::callOnTransition(QEvent *e) } } + QT_END_NAMESPACE #endif //QT_NO_STATEMACHINE diff --git a/src/corelib/statemachine/qsignaltransition.h b/src/corelib/statemachine/qsignaltransition.h index 12f021d78e..792fb12a14 100644 --- a/src/corelib/statemachine/qsignaltransition.h +++ b/src/corelib/statemachine/qsignaltransition.h @@ -53,8 +53,9 @@ class QSignalTransitionPrivate; class Q_CORE_EXPORT QSignalTransition : public QAbstractTransition { Q_OBJECT - Q_PROPERTY(QObject* senderObject READ senderObject WRITE setSenderObject) - Q_PROPERTY(QByteArray signal READ signal WRITE setSignal) + Q_PROPERTY(QObject* senderObject READ senderObject WRITE setSenderObject NOTIFY senderObjectChanged) + Q_PROPERTY(QByteArray signal READ signal WRITE setSignal NOTIFY signalChanged) + public: QSignalTransition(QState *sourceState = 0); QSignalTransition(const QObject *sender, const char *signal, @@ -73,6 +74,18 @@ protected: bool event(QEvent *e); +Q_SIGNALS: + void senderObjectChanged( +#if !defined(Q_QDOC) + QPrivateSignal +#endif + ); + void signalChanged( +#if !defined(Q_QDOC) + QPrivateSignal +#endif + ); + private: Q_DISABLE_COPY(QSignalTransition) Q_DECLARE_PRIVATE(QSignalTransition)