Home

QtAbstractTransition Class Reference
[QtCore module]

The QtAbstractTransition class is the base class of transitions between QtAbstractState objects. More...

 #include <QtAbstractTransition>

Inherits QObject.

Inherited by QtTransition.

This class was introduced in qtstatemachine 4.6.

Properties

Public Functions

Protected Functions

Additional Inherited Members


Detailed Description

The QtAbstractTransition class is the base class of transitions between QtAbstractState objects.

The QtAbstractTransition class is the abstract base class of transitions between states (QtAbstractState objects) of a QtStateMachine. QtAbstractTransition is part of The State Machine Framework.

The QtTransition class provides a default (action-based) implementation of the QtAbstractTransition interface.

The sourceState() function returns the source of the transition. The targetStates() function returns the targets of the transition.

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.


Property Documentation

source : QtState * const

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

Access functions:

target : QtAbstractState *

This property holds the target state of this transition.

Access functions:

targets : QList<QtAbstractState *>

This property holds the target states of this transition.

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

Access functions:


Member Function Documentation

QtAbstractTransition::QtAbstractTransition ( QtState * sourceState = 0 )

Constructs a new QtAbstractTransition object with the given sourceState.

QtAbstractTransition::QtAbstractTransition ( const QList<QtAbstractState *> & targets, QtState * sourceState = 0 )

Constructs a new QtAbstractTransition object with the given targets and sourceState.

QtAbstractTransition::~QtAbstractTransition ()   [virtual]

Destroys this transition.

void QtAbstractTransition::addAnimation ( QAbstractAnimation * animation )

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

See also removeAnimation() and animations().

QList<QAbstractAnimation *> QtAbstractTransition::animations () const

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

See also addAnimation().

bool QtAbstractTransition::eventTest ( QEvent * event ) const   [pure virtual protected]

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.

void QtAbstractTransition::onTransition ()   [pure virtual protected]

This function is called when the transition is triggered. Reimplement this function to perform custom processing when the transition is triggered.

void QtAbstractTransition::removeAnimation ( QAbstractAnimation * animation )

Removes the given animation from this transition.

See also addAnimation().


Copyright © 2009 Nokia Trademarks
Qt Solutions