PySide6.QtStateMachine.QSignalTransition¶
- class QSignalTransition¶
The
QSignalTransition
class provides a transition based on a Qt signal. More…Synopsis¶
Properties¶
senderObjectᅟ
- The sender object that this signal transition is associated withsignalᅟ
- The signal that this signal transition is associated with
Methods¶
def
__init__()
def
senderObject()
def
setSignal()
def
signal()
Signals¶
def
signalChanged()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
Typically you would use the overload of
addTransition()
that takes a sender and signal as arguments, rather than creatingQSignalTransition
objects directly.QSignalTransition
is part of Qt State Machine Framework .You can subclass
QSignalTransition
and reimplementeventTest()
to make a signal transition conditional; the event object passed toeventTest()
will be aSignalEvent
object. Example:class CheckedTransition : public QSignalTransition { public: CheckedTransition(QCheckBox *check) : QSignalTransition(check, SIGNAL(stateChanged(int))) {} protected: bool eventTest(QEvent *e) { if (!QSignalTransition::eventTest(e)) return false; QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e); return (se->arguments().at(0).toInt() == Qt::Checked); } }; ... QCheckBox *check = new QCheckBox(); check->setTristate(true); QState *s1 = new QState(); QState *s2 = new QState(); CheckedTransition *t1 = new CheckedTransition(check); t1->setTargetState(s2); s1->addTransition(t1);
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.This property holds the sender object that this signal transition is associated with.
- Access functions:
- property signalᅟ: QByteArray¶
This property holds the signal that this signal transition is associated with.
- Access functions:
Signal
signalChanged()
Constructs a new signal transition with the given
sourceState
.- __init__(signal[, state=None])
- Parameters:
signal – object
state –
QState
- __init__(sender, signal[, sourceState=None])
Constructs a new signal transition associated with the given
signal
of the givensender
, and with the givensourceState
.Returns the sender object associated with this signal transition.
See also
Getter of property
senderObjectᅟ
.- senderObjectChanged()¶
This signal is emitted when the
senderObject
property is changed.See also
Notification signal of property
senderObjectᅟ
.Sets the
sender
object associated with this signal transition.See also
Setter of property
senderObjectᅟ
.- setSignal(signal)¶
- Parameters:
signal –
QByteArray
Sets the
signal
associated with this signal transition.See also
Setter of property
signalᅟ
.- signal()¶
- Return type:
Returns the signal associated with this signal transition.
See also
Getter of property
signalᅟ
.- signalChanged()¶
This signal is emitted when the signal property is changed.
See also
Notification signal of property
signalᅟ
.