PySide6.QtStateMachine.QEventTransition¶
- class QEventTransition¶
- The - QEventTransitionclass provides a QObject-specific transition for Qt events. More…- Inherited by: - QMouseEventTransition,- QKeyEventTransition- Synopsis¶- Properties¶- eventSourceᅟ- The event source that this event transition is associated with
- eventTypeᅟ- The type of event that this event transition is associated with
 - Methods¶- def - __init__()
- def - eventSource()
- def - eventType()
- def - setEventSource()
- def - setEventType()
 - 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¶- A - QEventTransitionobject binds an event to a particular QObject.- QEventTransitionis part of Qt State Machine Framework .- Example: - QPushButton *button = ...; QState *s1 = ...; QState *s2 = ...; // If in s1 and the button receives an Enter event, transition to s2 QEventTransition *enterTransition = new QEventTransition(button, QEvent::Enter); enterTransition->setTargetState(s2); s1->addTransition(enterTransition); // If in s2 and the button receives an Exit event, transition back to s1 QEventTransition *leaveTransition = new QEventTransition(button, QEvent::Leave); leaveTransition->setTargetState(s1); s2->addTransition(leaveTransition); - Subclassing¶- When reimplementing the - eventTest()function, you should first call the base implementation to verify that the event is a- WrappedEventfor the proper object and event type. You may then cast the event to a- WrappedEventand get the original event by calling- event(), and perform additional checks on that object.- See also - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- This property holds the event source that this event transition is associated with. - Access functions:
 - property eventTypeᅟ: QEvent.Type¶
 - This property holds the type of event that this event transition is associated with. - Access functions:
 - Constructs a new - QEventTransitionobject with the given- sourceState.- __init__(object, type[, sourceState=None])
 - Constructs a new - QEventTransitionobject associated with events of the given- typefor the given- object, and with the given- sourceState.- Returns the event source associated with this event transition. - See also - Getter of property - eventSourceᅟ.- Returns the event type that this event transition is associated with. - See also - Getter of property - eventTypeᅟ.- Sets the event source associated with this event transition to be the given - object.- See also - Setter of property - eventSourceᅟ.- Sets the event - typethat this event transition is associated with.- See also - Setter of property - eventTypeᅟ.