QAbstractTransition Class Reference

[ QtCore module]

The QAbstractTransition class is the base class of transitions between QAbstractState 对象。 更多...

继承 QObject .

Inherited by QEventTransition and QSignalTransition .

方法

Qt Signals


详细描述

The QAbstractTransition class is the base class of transitions between QAbstractState 对象。

The QAbstractTransition class is the abstract base class of transitions between states ( QAbstractState 对象) 的 QStateMachine . QAbstractTransition is part of The State Machine Framework .

sourceState () function returns the source of the transition. The targetStates () function returns the targets of the transition. The machine () 函数返回 the state machine that the transition is part of.

triggered () signal is emitted when the transition has been triggered.

过渡可以导致动画播放。使用 addAnimation () function to add an animation to the transition.

子类化

eventTest () function is called by the state machine to determine whether an event should trigger the transition. In your reimplementation you typically check the event type and cast the event object to the proper type, and check that one or more properties of the event meet your criteria.

onTransition () function is called when the transition is triggered; reimplement this function to perform custom processing for the transition.


方法文档编制

QAbstractTransition.__init__ ( self , QState   sourceState  = None)

sourceState argument, if not None, causes self to be owned by Qt instead of PyQt.

构造新 QAbstractTransition object with the given sourceState .

QAbstractTransition.addAnimation ( self , QAbstractAnimation   animation )

添加给定 animation to this transition. The transition does not take ownership of the animation.

另请参阅 removeAnimation () and animations ().

list-of-QAbstractAnimation QAbstractTransition.animations ( self )

Returns the list of animations associated with this transition, or an empty list if it has no animations.

另请参阅 addAnimation ().

bool QAbstractTransition.event ( self , QEvent   e )

重实现自 QObject.event ().

bool QAbstractTransition.eventTest ( self , QEvent   event )

This method is abstract and should be reimplemented in any sub-class.

This function is called to determine whether the given event should cause this transition to trigger. Reimplement this function and return true if the event should trigger the transition, otherwise return false.

QStateMachine QAbstractTransition.machine ( self )

Returns the state machine that this transition is part of, or 0 if the transition is not part of a state machine.

QAbstractTransition.onTransition ( self , QEvent   event )

This method is abstract and should be reimplemented in any sub-class.

This function is called when the transition is triggered. The given event is what caused the transition to trigger. Reimplement this function to perform custom processing when the transition is triggered.

QAbstractTransition.removeAnimation ( self , QAbstractAnimation   animation )

移除给定 animation from this transition.

另请参阅 addAnimation ().

QAbstractTransition.setTargetState ( self , QAbstractState   target )

QAbstractTransition.setTargetStates ( self , list-of-QAbstractState  targets )

QState QAbstractTransition.sourceState ( self )

QAbstractState QAbstractTransition.targetState ( self )

list-of-QAbstractState QAbstractTransition.targetStates ( self )


Qt Signal Documentation

void triggered ()

This is the default overload of this signal.

This signal is emitted when the transition has been triggered (after onTransition () has been called).