内容表

上一话题

QAbstractTableModel

下一话题

QAnimationGroup

QAbstractTransition

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

Inheritance diagram of PySide2.QtCore.QAbstractTransition

继承者: QEventTransition , QSignalTransition , QKeyEventTransition , QMouseEventTransition

4.6 版新增。

概要

虚函数

详细描述

QAbstractTransition class is the abstract base class of transitions between states ( QAbstractState 对象) 的 QStateMachine . QAbstractTransition is part of 状态机框架 .

sourceState() function returns the source of the transition. The targetStates() function returns the targets of the transition. The machine() function returns 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.

class QAbstractTransition ( [ sourceState=None ] )
param sourceState

QState

构造新 QAbstractTransition 对象采用给定 sourceState .

PySide2.QtCore.QAbstractTransition. TransitionType

This enum specifies the kind of transition. By default, the type is an external transition.

常量

描述

QAbstractTransition.ExternalTransition

Any state that is the source state of a transition (which is not a target-less transition) is left, and re-entered when necessary.

QAbstractTransition.InternalTransition

If the target state of a transition is a sub-state of a compound state, and that compound state is the source state, an internal transition will not leave the source state.

另请参阅

transitionType

New in version 5.5.

PySide2.QtCore.QAbstractTransition. addAnimation ( animation )
参数

animation QAbstractAnimation

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

PySide2.QtCore.QAbstractTransition. animations ( )
返回类型

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

另请参阅

addAnimation()

PySide2.QtCore.QAbstractTransition. eventTest ( event )
参数

event QEvent

返回类型

bool

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.

PySide2.QtCore.QAbstractTransition. machine ( )
返回类型

QStateMachine

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

PySide2.QtCore.QAbstractTransition. onTransition ( event )
参数

event QEvent

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.

PySide2.QtCore.QAbstractTransition. removeAnimation ( animation )
参数

animation QAbstractAnimation

移除给定 animation from this transition.

另请参阅

addAnimation()

PySide2.QtCore.QAbstractTransition. setTargetState ( target )
参数

target QAbstractState

设置 target state of this transition.

另请参阅

targetState()

PySide2.QtCore.QAbstractTransition. setTargetStates ( targets )
参数

targets

Sets the target states of this transition to be the given targets .

另请参阅

targetStates()

PySide2.QtCore.QAbstractTransition. setTransitionType ( type )
参数

type TransitionType

Sets the type of the transition to type .

另请参阅

transitionType()

PySide2.QtCore.QAbstractTransition. sourceState ( )
返回类型

QState

Returns the source state of this transition, or None if this transition has no source state.

PySide2.QtCore.QAbstractTransition. targetState ( )
返回类型

QAbstractState

Returns the target state of this transition, or None if the transition has no target.

另请参阅

setTargetState()

PySide2.QtCore.QAbstractTransition. targetStates ( )
返回类型

Returns the target states of this transition, or an empty list if this transition has no target states.

另请参阅

setTargetStates()

PySide2.QtCore.QAbstractTransition. transitionType ( )
返回类型

TransitionType

Returns the type of the transition.