Home

QtTransition Class Reference
[QtCore module]

The QtTransition class provides an action-based transition. More...

 #include <QtTransition>

Inherits QtAbstractTransition.

Inherited by QtEventTransition, QtScriptedTransition, QtSignalTransition, and QtStateFinishedTransition.

This class was introduced in qtstatemachine 4.6.

Public Functions

Additional Inherited Members


Detailed Description

The QtTransition class provides an action-based transition.

QtTransition provides an action-based transition; you add actions with the addAction() function. The transition executes the actions when the transition is triggered. QtTransition is part of The State Machine Framework.

The invokeMethodOnTransition() function is used for defining method invocations that should be performed when a transition is taken.

 QtStateMachine machine;
 QtState *s1 = new QtState();
 machine.addState(s1);
 QtTransition *t1 = new QtTransition();
 QLabel label;
 t1->invokeMethodOnTransition(&label, "clear");
 QtState *s2 = new QtState();
 machine.addState(s2);
 t1->setTargetState(s2);
 s1->addTransition(t1);

Actions are executed in the order in which they were added.

See also QtState::addTransition() and QtStateAction.


Member Function Documentation

QtTransition::QtTransition ( QtState * sourceState = 0 )

Constructs a new QtTransition object with the given sourceState.

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

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

QtTransition::~QtTransition ()

Destroys this transition.

QList<QtStateAction *> QtTransition::actions () const

Returns this transitions's actions, or an empty list if the transition has no actions.

See also addAction().

void QtTransition::addAction ( QtStateAction * action )

Adds the given action to this transition. The action will be executed when the transition is triggered. The transition takes ownership of the action.

See also removeAction().

void QtTransition::invokeMethodOnTransition ( QObject * object, const char * method, const QList<QVariant> & arguments = QList<QVariant> () )

Instructs this QtTransition to invoke the given method of the given object with the given arguments when the transition is taken. This function will create a QtStateInvokeMethodAction object and add it to the actions of the transition.

void QtTransition::removeAction ( QtStateAction * action )

Removes the given action from this transition. The transition releases ownership of the action.

See also addAction().


Copyright © 2009 Nokia Trademarks
Qt Solutions