QAbstractTransition

Inherited by: QSignalTransition, QEventTransition, QMouseEventTransition, QKeyEventTransition

Note

This class was introduced in Qt 4.6

Synopsis

Functions

Virtual functions

Signals

Detailed Description

The PySide.QtCore.QAbstractTransition class is the base class of transitions between PySide.QtCore.QAbstractState objects.

The PySide.QtCore.QAbstractTransition class is the abstract base class of transitions between states ( PySide.QtCore.QAbstractState objects) of a PySide.QtCore.QStateMachine . PySide.QtCore.QAbstractTransition is part of The State Machine Framework .

The PySide.QtCore.QAbstractTransition.sourceState() function returns the source of the transition. The PySide.QtCore.QAbstractTransition.targetStates() function returns the targets of the transition. The PySide.QtCore.QAbstractTransition.machine() function returns the state machine that the transition is part of.

The PySide.QtCore.QAbstractTransition.triggered() signal is emitted when the transition has been triggered.

Transitions can cause animations to be played. Use the PySide.QtCore.QAbstractTransition.addAnimation() function to add an animation to the transition.

Subclassing

The PySide.QtCore.QAbstractTransition.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 PySide.QtCore.QAbstractTransition.onTransition() function is called when the transition is triggered; reimplement this function to perform custom processing for the transition.

class PySide.QtCore.QAbstractTransition([sourceState=None])
Parameters:sourceStatePySide.QtCore.QState

Constructs a new PySide.QtCore.QAbstractTransition object with the given sourceState .

PySide.QtCore.QAbstractTransition.addAnimation(animation)
Parameters:animationPySide.QtCore.QAbstractAnimation

Adds the given animation to this transition. The transition does not take ownership of the animation.

PySide.QtCore.QAbstractTransition.animations()
Return type:

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

PySide.QtCore.QAbstractTransition.eventTest(event)
Parameters:eventPySide.QtCore.QEvent
Return type:PySide.QtCore.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.

PySide.QtCore.QAbstractTransition.machine()
Return type:PySide.QtCore.QStateMachine

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

PySide.QtCore.QAbstractTransition.onTransition(event)
Parameters:eventPySide.QtCore.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.

PySide.QtCore.QAbstractTransition.removeAnimation(animation)
Parameters:animationPySide.QtCore.QAbstractAnimation

Removes the given animation from this transition.

PySide.QtCore.QAbstractTransition.setTargetState(target)
Parameters:targetPySide.QtCore.QAbstractState

This property holds the target state of this transition.

If a transition has no target state, the transition may still be triggered, but this will not cause the state machine’s configuration to change (i.e. the current state will not be exited and re-entered).

PySide.QtCore.QAbstractTransition.setTargetStates(targets)
Parameters:targets

This property holds the target states of this transition.

If multiple states are specified, all must be descendants of the same parallel group state.

PySide.QtCore.QAbstractTransition.sourceState()
Return type:PySide.QtCore.QState

This property holds the source state (parent) of this transition.

PySide.QtCore.QAbstractTransition.targetState()
Return type:PySide.QtCore.QAbstractState

This property holds the target state of this transition.

If a transition has no target state, the transition may still be triggered, but this will not cause the state machine’s configuration to change (i.e. the current state will not be exited and re-entered).

PySide.QtCore.QAbstractTransition.targetStates()
Return type:

This property holds the target states of this transition.

If multiple states are specified, all must be descendants of the same parallel group state.

PySide.QtCore.QAbstractTransition.triggered()