QAbstractTransition露
- PyQt5.QtCore.QAbstractTransition
Inherits from QObject.
Inherited by QEventTransition, QSignalTransition.
Description露
The QAbstractTransition class is the base class of transitions between QAbstractState objects.
The QAbstractTransition class is the abstract base class of transitions between states (QAbstractState objects) of a QStateMachine. QAbstractTransition is part of The State Machine Framework.
The 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.
The triggered signal is emitted when the transition has been triggered.
Transitions can cause animations to be played. Use the addAnimation() function to add an animation to the transition.
Subclassing露
The 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.
The onTransition() function is called when the transition is triggered; reimplement this function to perform custom processing for the transition.
Enums露
- TransitionType
This enum specifies the kind of transition. By default, the type is an external transition.
See also
Member
Value
Description
ExternalTransition 0
Any state that is the source state of a transition (which is not a target-less transition) is left, and re-entered when necessary.
InternalTransition 1
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.
Methods露
- __init__(sourceState: QState = None)
TODO
- addAnimation(QAbstractAnimation)
TODO
- animations() → List[QAbstractAnimation]
TODO
- event(QEvent) → bool
TODO
- eventTest(QEvent) → bool
TODO
- machine() → QStateMachine
Returns the state machine that this transition is part of, or 0 if the transition is not part of a state machine.
- onTransition(QEvent)
TODO
- removeAnimation(QAbstractAnimation)
TODO
- setTargetState(QAbstractState)
Sets the target state of this transition.
See also
- setTargetStates(Iterable[QAbstractState])
Sets the target states of this transition to be the given targets.
See also
- setTransitionType(TransitionType)
Sets the type of the transition to type.
See also
- sourceState() → QState
Returns the source state of this transition, or 0 if this transition has no source state.
- targetState() → QAbstractState
Returns the target state of this transition, or 0 if the transition has no target.
See also
- targetStates() → List[QAbstractState]
Returns the target states of this transition, or an empty list if this transition has no target states.
See also
- transitionType() → TransitionType
Returns the type of the transition.
See also