Home · All Classes · Modules  · QSS HELP  · QSS 案例 · VER007 HOME

QEventTransition Class Reference
[QtCore module]

该QEventTransition类提供了一个QObject特定于Qt的事件过渡。More...

继承QAbstractTransition

通过继承QKeyEventTransitionQMouseEventTransition

Methods


Detailed Description

该QEventTransition类提供了一个QObject特定于Qt的事件过渡。

一个QEventTransition对象的事件绑定到一个特定的QObject。 QEventTransition是一部分The State Machine Framework

例如:

 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

当重新实现eventTest( )函数,你应该先调用基实现,以验证该事件是QStateMachine.WrappedEvent为正确的对象和事件类型。然后,您可投的情况下,以一QStateMachine.WrappedEvent并通过调用得到的原始事件QStateMachine.WrappedEvent.event( ) ,并执行该对象上的额外检查。


Method Documentation

QEventTransition.__init__ (self, QState sourceState = None)

sourceState的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。

构造一个新的QEventTransition与给定对象sourceState

QEventTransition.__init__ (self, QObject object, QEvent.Type type, QState sourceState = None)

sourceState的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。

构造一个新的QEventTransition与给定的事件相关联的对象type对于给定的object,并用给定的sourceState

bool QEventTransition.event (self, QEvent e)

从重新实现QObject.event( ) 。

QObject QEventTransition.eventSource (self)

bool QEventTransition.eventTest (self, QEvent event)

从重新实现QAbstractTransition.eventTest( ) 。

QEvent.Type QEventTransition.eventType (self)

QEventTransition.onTransition (self, QEvent event)

从重新实现QAbstractTransition.onTransition( ) 。

QEventTransition.setEventSource (self, QObject object)

QEventTransition.setEventType (self, QEvent.Type type)




PyQt 4.10.3 for X11 Copyright © Riverbank Computing Ltd and Nokia 2012 Qt 4.8.5