QAbstractTransitionclass is the base class of transitions betweenQAbstractState对象。 更多 …
继承者: QEventTransition , QSignalTransition , QKeyEventTransition , QMouseEventTransition
4.6 版新增。
def
addAnimation
(animation)
def
animations
()
def
machine
()
def
removeAnimation
(animation)
def
setTargetState
(target)
def
setTargetStates
(targets)
def
setTransitionType
(type)
def
sourceState
()
def
targetState
()
def
targetStates
()
def
transitionType
()
def
eventTest
(event)
def
onTransition
(event)
QAbstractTransitionclass is the abstract base class of transitions between states (QAbstractState对象) 的QStateMachine.QAbstractTransitionis part of 状态机框架 .
sourceState()function returns the source of the transition. ThetargetStates()function returns the targets of the transition. Themachine()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.
QAbstractTransition
(
[
sourceState=None
]
)
¶
- param sourceState
构造新
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. |
另请参阅
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.
另请参阅
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
(
)
¶
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.
另请参阅
PySide2.QtCore.QAbstractTransition.
setTargetState
(
target
)
¶
target
–
QAbstractState
设置
target
state of this transition.
另请参阅
PySide2.QtCore.QAbstractTransition.
setTargetStates
(
targets
)
¶
targets –
Sets the target states of this transition to be the given
targets
.
另请参阅
PySide2.QtCore.QAbstractTransition.
setTransitionType
(
type
)
¶
type
–
TransitionType
Sets the type of the transition to
type
.
另请参阅
PySide2.QtCore.QAbstractTransition.
sourceState
(
)
¶
Returns the source state of this transition, or
None
if this transition has no source state.
PySide2.QtCore.QAbstractTransition.
targetState
(
)
¶
Returns the target state of this transition, or
None
if the transition has no target.
另请参阅
PySide2.QtCore.QAbstractTransition.
targetStates
(
)
¶
Returns the target states of this transition, or an empty list if this transition has no target states.
另请参阅
PySide2.QtCore.QAbstractTransition.
transitionType
(
)
¶
Returns the type of the transition.
另请参阅