QEventTransition

Inheritance diagram of QEventTransition

Inherited by: QMouseEventTransition, QKeyEventTransition

Note

This class was introduced in Qt 4.6

Synopsis

Functions

Detailed Description

The PySide.QtCore.QEventTransition class provides a PySide.QtCore.QObject -specific transition for Qt events.

A PySide.QtCore.QEventTransition object binds an event to a particular PySide.QtCore.QObject . PySide.QtCore.QEventTransition is part of The 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 PySide.QtCore.QEventTransition.eventTest() function, you should first call the base implementation to verify that the event is a QStateMachine.WrappedEvent for the proper object and event type. You may then cast the event to a QStateMachine.WrappedEvent and get the original event by calling QStateMachine.WrappedEvent.event() , and perform additional checks on that object.

class PySide.QtCore.QEventTransition(object, type[, sourceState=None])
class PySide.QtCore.QEventTransition([sourceState=None])
Parameters:

Constructs a new PySide.QtCore.QEventTransition object with the given sourceState .

PySide.QtCore.QEventTransition.eventSource()
Return type:PySide.QtCore.QObject

This property holds the event source that this event transition is associated with.

PySide.QtCore.QEventTransition.eventType()
Return type:PySide.QtCore.QEvent.Type

This property holds the type of event that this event transition is associated with.

PySide.QtCore.QEventTransition.setEventSource(object)
Parameters:objectPySide.QtCore.QObject

This property holds the event source that this event transition is associated with.

PySide.QtCore.QEventTransition.setEventType(type)
Parameters:typePySide.QtCore.QEvent.Type

This property holds the type of event that this event transition is associated with.