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

- List of all members, including inherited members

### Public Functions

- QtAbstractTransition ( const QList<QEvent::Type> & eventTypes = QList<QEvent::Type> () )
- QtAbstractTransition ( QEvent::Type eventType )
- virtual ~QtAbstractTransition ()
- QtAbstractState * sourceState () const
- QList<QtAbstractState *> targetStates () const

- 29 public functions inherited from QObject

### Protected Functions

- virtual void onTransition () = 0
- virtual bool testCondition ( QEvent * event ) const

- 7 protected 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 variables inherited from QObject

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

### Subclassing

The testCondition() function is called by the state machine to determine whether the condition(s) associated with the transition is satisfied.

The onTransition() function is called when the transition is triggered; reimplement this function to perform custom processing for the transition.

## Member Function Documentation

### QtAbstractTransition::QtAbstractTransition ( 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().

### QtAbstractTransition::QtAbstractTransition ( QEvent::Type eventType )

Constructs a new transition associated with the given eventType.

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

### QtAbstractTransition::~QtAbstractTransition () `[virtual]`

Destroys this transition.

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

### QtAbstractState * QtAbstractTransition::sourceState () const

Returns the source state of this transition, or 0 if this transition has no source state.

### QList<QtAbstractState *> QtAbstractTransition::targetStates () const

Returns the target states of this transition, or an empty list if this transition has no target states.

### bool QtAbstractTransition::testCondition ( QEvent * event ) const `[virtual protected]`

This function is called to determine whether the condition (if any) associated with this transition is satisfied. The default implementation returns true, i.e. there is no condition associated with the transition.

You are guaranteed that the event is of the type that was passed to the QtAbstractTransition constructor (i.e. it is safe to static_cast it).