Home

QtActionState Class Reference
[QtCore module]

The QtActionState class provides an action-based state. More...

 #include <QtActionState>

Inherits QtAbstractState.

Inherited by QtFinalState and QtState.

This class was introduced in qtstatemachine 4.6.

Public Functions

Additional Inherited Members


Detailed Description

The QtActionState class provides an action-based state.

QtActionState executes state actions when the state is entered and exited. QtActionState is part of The State Machine Framework.

You can add actions to a state with the addEntryAction() and addExitAction() functions. The state executes the actions when the state is entered and exited, respectively.

The invokeMethodOnEntry() and invokeMethodOnExit() functions are used for defining method invocations that should be performed when a state is entered and exited, respectively.

 QtState *s2 = new QtState();
 s2->invokeMethodOnEntry(&label, "showMaximized");
 machine.addState(s2);

See also QtStateAction.


Member Function Documentation

QtActionState::QtActionState ( QtState * parent = 0 )

Constructs a new action state with the given parent state.

QtActionState::~QtActionState ()

Destroys this action state.

void QtActionState::addEntryAction ( QtStateAction * action )

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

See also addExitAction() and removeEntryAction().

void QtActionState::addExitAction ( QtStateAction * action )

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

See also addEntryAction() and removeExitAction().

QList<QtStateAction *> QtActionState::entryActions () const

Returns this state's entry actions.

See also addEntryAction() and exitActions().

QList<QtStateAction *> QtActionState::exitActions () const

Returns this state's exit actions.

See also addExitAction() and entryActions().

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

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

See also invokeMethodOnExit() and addEntryAction().

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

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

See also invokeMethodOnEntry() and addExitAction().

void QtActionState::removeEntryAction ( QtStateAction * action )

Removes the given entry action from this state. The state releases ownership of the action.

See also addEntryAction().

void QtActionState::removeExitAction ( QtStateAction * action )

Removes the given exit action from this state. The state releases ownership of the action.

See also addExitAction().


Copyright © 2009 Nokia Trademarks
Qt Solutions