|  | Home

# QtTransition Class Reference
[QtCore module]

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

     #include <QtTransition>

Inherits QtAbstractTransition.

Inherited by QtEventTransition, QtSignalTransition, and QtStateFinishedTransition.

- List of all members, including inherited members

### Public Functions

- QtTransition ( const QList<QEvent::Type> & eventTypes = QList<QEvent::Type> () )
- QtTransition ( QEvent::Type eventType )
- ~QtTransition ()
- void addAction ( QtStateAction * action )
- void invokeMethodOnTransition ( QObject * object, const char * method, const QList<QVariant> & arguments = QList<QVariant> () )
- void setPropertyOnTransition ( QObject * object, const char * name, const QVariant & value )

- 2 public functions inherited from QtAbstractTransition
- 29 public functions inherited from QObject

### Additional Inherited Members

- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 1 signal inherited from QObject
- 1 public type inherited from QObject
- 4 static public members inherited from QObject
- 2 protected functions inherited from QtAbstractTransition
- 7 protected functions inherited from QObject
- 2 protected variables inherited from QObject

## 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.

     QtStateMachine machine;
     QtState *s1 = new QtState(machine.rootState());
     QtTransition *t1 = new QtTransition();
     QLabel label;
     t1->addAction(new QtTransition::SetPropertyAction(&label, "text", "Transition t1 was triggered"));
     QtState *s2 = new QtState(machine.rootState());
     s1->addTransition(t1, s2);

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

## Member Function Documentation

### QtTransition::QtTransition ( const QList<QEvent::Type> & eventTypes = QList<QEvent::Type> () )

Constructs a new transition associated with the given eventTypes.

The transition should be added to the appropriate state using QtAbstractState::addTransition().

### QtTransition::QtTransition ( QEvent::Type eventType )

Constructs a new transition with the given eventType.

You can add the transition to a state using QtAbstractState::addTransition().

### QtTransition::~QtTransition ()

Destroys this transition.

### 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.

### 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.

### void QtTransition::setPropertyOnTransition ( QObject * object, const char * name, const QVariant & value )

Instructs this QtTransition to set the property with the given name of the given object to the given value when the transition is taken.