Home

QtAbstractState Class Reference
[QtCore module]

The QtAbstractState class is the base class of states of a QtStateMachine. More...

 #include <QtAbstractState>

Inherits QObject.

Inherited by QtActionState and QtHistoryState.

This class was introduced in qtstatemachine 4.6.

Public Types

Properties

Public Functions

Protected Functions

Additional Inherited Members


Detailed Description

The QtAbstractState class is the base class of states of a QtStateMachine.

The QtAbstractState class is the abstract base class of states that are part of a QtStateMachine. It defines the interface that all state objects have in common. QtAbstractState is part of The State Machine Framework.

The assignProperty() function is used for defining property assignments that should be performed when a state is entered.

The parentState() function returns the state's parent state.

Subclassing

The onEntry() function is called when the state is entered; reimplement this function to perform custom processing when the state is entered.

The onExit() function is called when the state is exited; reimplement this function to perform custom processing when the state is exited.


Member Type Documentation

enum QtAbstractState::RestorePolicy

This enum specifies the restore policy type for a state. The restore policy takes effect when the machine enters a state which sets one or more properties. If the restore policy of the state is set to RestoreProperties, the state machine will save the original value of the property before the new value is set.

Later, when the machine either enters a state which has its restore policy set to DoNotRestoreProperties or when it enters a state which does not set a value for the given property, the property will automatically be restored to its initial value.

Only one initial value will be saved for any given property. If a value for a property has already been saved by the state machine, it will not be overwritten until the property has been successfully restored. Once the property has been restored, the state machine will clear the initial value until it enters a new state which sets the property and which has RestoreProperties as its restore policy.

ConstantValueDescription
QtAbstractState::GlobalRestorePolicy0The restore policy for the state should be retrieved using QtStateMachine::globalRestorePolicy()
QtAbstractState::DoNotRestoreProperties1The state machine should not save the initial values of properties set in the state and restore them later.
QtAbstractState::RestoreProperties2The state machine should save the initial values of properties set in the state and restore them later.

See also setRestorePolicy(), restorePolicy(), and QtAbstractState::assignProperty().


Property Documentation

restorePolicy : RestorePolicy

This property holds the restore policy of this state.

Access functions:


Member Function Documentation

QtAbstractState::QtAbstractState ( QtState * parent = 0 )   [protected]

Constructs a new state with the given parent state.

QtAbstractState::~QtAbstractState ()

Destroys this state.

void QtAbstractState::assignProperty ( QObject * object, const char * name, const QVariant & value )

Instructs this state to set the property with the given name of the given object to the given value when the state is entered.

void QtAbstractState::onEntry ()   [pure virtual protected]

This function is called when the state is entered. Reimplement this function to perform custom processing when the state is entered.

void QtAbstractState::onExit ()   [pure virtual protected]

This function is called when the state is exited. Reimplement this function to perform custom processing when the state is exited.

QtState * QtAbstractState::parentState () const

Returns this state's parent state, or 0 if the state has no parent state.


Copyright © 2009 Nokia Trademarks
Qt Solutions