Emit a notifications when senderObject and signal are changed.
In order to properly use QSignalTransition object in QML we need to know when these properties are changed. Change-Id: I7ca318d50513086146b85eaeee4dabbcdef8c299 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
This commit is contained in:
parent
e65a79a6e4
commit
dd1598e1aa
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user