继承者: QMouseEventTransition , QKeyEventTransition
注意
该类在 Qt4.6 引入
PySide.QtCore.QEventTransition 类提供 PySide.QtCore.QObject 特定过渡为 Qt 事件。
A PySide.QtCore.QEventTransition object binds an event to a particular PySide.QtCore.QObject . PySide.QtCore.QEventTransition is part of 状态机框架 .
范例:
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);
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.
| 参数: |
|
|---|
构造新 PySide.QtCore.QEventTransition 对象采用给定 sourceState .
| 返回类型: | PySide.QtCore.QObject |
|---|
This property holds the event source that this event transition is associated with.
| 返回类型: | PySide.QtCore.QEvent.Type |
|---|
This property holds the type of event that this event transition is associated with.
| 参数: | object – PySide.QtCore.QObject |
|---|
This property holds the event source that this event transition is associated with.
| 参数: | type – PySide.QtCore.QEvent.Type |
|---|
This property holds the type of event that this event transition is associated with.