Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtCore.QStateMachine Class Reference

The QStateMachine class provides a hierarchical finite state machine. More...

Inheritance diagram for QtCore.QStateMachine:
Collaboration diagram for QtCore.QStateMachine:

Public Types

enum  Error { NoCommonAncestorForTransitionError = 3, NoDefaultStateInHistoryStateError = 2, NoError = 0, NoInitialStateError = 1 }
  More...
 
enum  EventPriority { HighPriority = 1, NormalPriority = 0 }
  More...
 
enum  RestorePolicy { DontRestoreProperties = 0, RestoreProperties = 1 }
  More...
 
- Public Types inherited from QtCore.QState
enum  ChildMode { ExclusiveStates = 0, ParallelStates = 1 }
  More...
 

Public Member Functions

 QStateMachine (QObject parent=null)
 
 
override void CreateProxy ()
 
new void AddDefaultAnimation (QAbstractAnimation animation)
 
 
new void AddState (QAbstractState state)
 
 
new bool OnCancelDelayedEvent (int id)
 
 
new void ClearError ()
 
 
new
System.Collections.Generic.List
< QAbstractState
Configuration ()
 
 
new
System.Collections.Generic.List
< QAbstractAnimation
DefaultAnimations ()
 
 
new QStateMachine.Error error ()
 
 
override bool OnEvent (QEvent e)
 
 
override bool EventFilter (QObject watched, QEvent @event)
 
 
new bool IsRunning ()
 
 
new int OnPostDelayedEvent (QEvent @event, int delay)
 
 
new void OnPostEvent (QEvent @event)
 
 
new void OnPostEvent (QEvent @event, QStateMachine.EventPriority priority=QStateMachine.EventPriority.NormalPriority)
 
 
new void RemoveDefaultAnimation (QAbstractAnimation animation)
 
 
new void RemoveState (QAbstractState state)
 
 
new void Start ()
 
 
new void Stop ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QState
 QState (QState parent=null)
 
 
 QState (QState.ChildMode childMode, QState parent=null)
 
 
new void AddTransition (QAbstractTransition transition)
 
 
new QAbstractTransition AddTransition (QAbstractState target)
 
 
new QSignalTransition AddTransition (QObject sender, string signal, QAbstractState target)
 
 
new void AssignProperty (QObject @object, string name, object value)
 
 
new void RemoveTransition (QAbstractTransition transition)
 
 
new
System.Collections.Generic.List
< QAbstractTransition
Transitions ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QAbstractState
new QStateMachine Machine ()
 
 
new QState ParentState ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
 
 
new bool BlockSignals (bool b)
 
 
new
System.Collections.Generic.List
< QObject
Children ()
 
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
new void DeleteLater ()
 
 
new bool Disconnect (QObject receiver, string member=null)
 
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
 
 
new void DumpObjectInfo ()
 
 
new void DumpObjectTree ()
 
 
new
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames ()
 
 
virtual bool EventFilter (QObject arg1, QEvent arg2)
 
 
new bool Inherits (string classname)
 
 
new void InstallEventFilter (QObject arg1)
 
 
new bool IsWidgetType ()
 
 
new void KillTimer (int id)
 
 
new object Property (string name)
 
 
new void RemoveEventFilter (QObject arg1)
 
 
new bool SetProperty (string name, object value)
 
 
new void SetUserData (uint id, QObjectUserData data)
 
new bool SignalsBlocked ()
 
 
new int StartTimer (int interval)
 
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 

Static Public Member Functions

static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QState
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QAbstractState
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QObject
static bool Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection)
 
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
 
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
 
 
static uint RegisterUserData ()
 
static string Tr (string s, string c=null)
 
 
static string Tr (string s, string c, int n)
 
 
static string TrUtf8 (string s, string c=null)
 
 
static string TrUtf8 (string s, string c, int n)
 
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream arg1, QSizeF arg2)
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream arg1, QPoint arg2)
 
static QDataStream Write (QDataStream arg1, QLineF arg2)
 
static QDataStream Write (QDataStream arg1, QPointF arg2)
 
static QDataStream Write (QDataStream arg1, QChar arg2)
 
static QDataStream Write (QDataStream arg1, QByteArray arg2)
 
static QDataStream Write (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Write (QDataStream arg1, QRectF arg2)
 
static QDataStream Write (QDataStream arg1, QDateTime arg2)
 
static QDataStream Write (QDataStream arg1, QUrl arg2)
 
static QDataStream Write (QDataStream arg1, QTime arg2)
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream arg1, QBitArray arg2)
 
static QDataStream Write (QDataStream arg1, QUuid arg2)
 
static QDataStream Write (QDataStream arg1, QLine arg2)
 
static QDataStream Write (QDataStream arg1, QDate arg2)
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
 
static QDataStream Write (QDataStream arg1, QRect arg2)
 
static QDataStream Write (QDataStream arg1, QSize arg2)
 
static QDataStream Write (QDataStream s, QVariant.Type p)
 
static QDataStream Write (QDataStream arg1, string arg2)
 
static QDataStream Write (QDataStream @out, System.Collections.Generic.List< string > list)
 
static QDataStream Read (QDataStream arg1, QChar arg2)
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream arg1, QRect arg2)
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream arg1, QDate arg2)
 
static QDataStream Read (QDataStream arg1, QUrl arg2)
 
static QDataStream Read (QDataStream arg1, QUuid arg2)
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream arg1, QLineF arg2)
 
static QDataStream Read (QDataStream arg1, QRectF arg2)
 
static QDataStream Read (QDataStream arg1, QPointF arg2)
 
static QDataStream Read (QDataStream arg1, QLine arg2)
 
static QDataStream Read (QDataStream arg1, QBitArray arg2)
 
static QDataStream Read (QDataStream arg1, QSize arg2)
 
static QDataStream Read (QDataStream arg1, QDateTime arg2)
 
static QDataStream Read (QDataStream arg1, QTime arg2)
 
static QDataStream Read (QDataStream arg1, QPoint arg2)
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream arg1, QByteArray arg2)
 
static QDataStream Read (QDataStream arg1, QSizeF arg2)
 
static QDataStream Read (QDataStream arg1, string arg2)
 
static QDataStream Read (QDataStream s, QVariant.Type p)
 
static QDataStream Read (QDataStream @in, System.Collections.Generic.List< string > list)
 
static double qAcos (double v)
 
static void qAddPostRoutine (System.Action arg1)
 
static string qAppName ()
 
static double qAsin (double v)
 
static double qAtan (double v)
 
static double qAtan2 (double x, double y)
 
static void qBadAlloc ()
 
static int qCeil (double v)
 
static ushort qChecksum (string s, uint len)
 
static QByteArray qCompress (QByteArray data)
 
static QByteArray qCompress (QByteArray data, int compressionLevel=-1)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
 
static double qCos (double v)
 
static double qExp (double v)
 
static double qFabs (double v)
 
static double qFastCos (double x)
 
static double qFastSin (double x)
 
static string qFlagLocation (string method)
 
static int qFloor (double v)
 
static bool qFuzzyCompare (double p1, double p2)
 
static bool qFuzzyCompare (float p1, float p2)
 
static bool qFuzzyIsNull (double d)
 
static bool qFuzzyIsNull (float f)
 
static uint qHash (QBitArray key)
 
static uint qHash (QChar key)
 
static uint qHash (QStringRef key)
 
static uint qHash (QUrl url)
 
static uint qHash (QPersistentModelIndex index)
 
static uint qHash (QByteArray key)
 
static uint qHash (QModelIndex index)
 
static uint qHash (uint key)
 
static uint qHash (sbyte key)
 
static uint qHash (byte key)
 
static uint qHash (short key)
 
static uint qHash (NativeLong key)
 
static uint qHash (ushort key)
 
static uint qHash (long key)
 
static uint qHash (ulong key)
 
static uint qHash (int key)
 
static uint qHash (string key)
 
static uint qHash (NativeULong key)
 
static double qInf ()
 
static Qt.ActionQtMsgTypeString qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1)
 
static int qIntCast (float f)
 
static int qIntCast (double f)
 
static bool qIsFinite (double d)
 
static bool qIsFinite (float f)
 
static bool qIsInf (float f)
 
static bool qIsInf (double d)
 
static bool qIsNaN (float f)
 
static bool qIsNaN (double d)
 
static bool qIsNull (float f)
 
static bool qIsNull (double d)
 
static double qLn (double v)
 
static double qPow (double x, double y)
 
static double qQNaN ()
 
static void qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
 
static void qRemovePostRoutine (System.Action arg1)
 
static int qRound (double d)
 
static long qRound64 (double d)
 
static double qSNaN ()
 
static bool qSharedBuild ()
 
static double qSin (double v)
 
static double qSqrt (double v)
 
static bool qStringComparisonHelper (QStringRef s1, string s2)
 
static double qTan (double v)
 
static QByteArray qUncompress (QByteArray data)
 
static QByteArray qUncompress (Pointer< byte > data, int nbytes)
 
static string qVersion ()
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
 
static bool Qputenv (string varName, QByteArray value)
 
static int Qrand ()
 
static void Qsrand (uint seed)
 
static int Qstrcmp (QByteArray str1, QByteArray str2)
 
static int Qstrcmp (QByteArray str1, string str2)
 
static int Qstrcmp (string str1, QByteArray str2)
 
static int Qstrcmp (string str1, string str2)
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
 
static Pointer< sbyte > Qstrdup (string arg1)
 
static int Qstricmp (string arg1, string arg2)
 
static uint Qstrlen (string str)
 
static int Qstrncmp (string str1, string str2, uint len)
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
 
static int Qstrnicmp (string arg1, string arg2, uint len)
 
static uint Qstrnlen (string str, uint maxlen)
 
static string QtTrId (string id, int n=-1)
 

Protected Member Functions

 QStateMachine (System.Type dummy)
 
virtual void BeginMicrostep (QEvent @event)
 
virtual void BeginSelectTransitions (QEvent @event)
 
virtual void EndMicrostep (QEvent @event)
 
virtual void EndSelectTransitions (QEvent @event)
 
override void OnEntry (QEvent @event)
 
 
override void OnExit (QEvent @event)
 
 
new void OnStarted ()
 
 
new void OnStopped ()
 
 
- Protected Member Functions inherited from QtCore.QState
 QState (System.Type dummy)
 
new void OnFinished ()
 
 
new void OnPropertiesAssigned ()
 
 
- Protected Member Functions inherited from QtCore.QAbstractState
 QAbstractState (System.Type dummy)
 
 QAbstractState (QState parent=null)
 
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void OnChildEvent (QChildEvent arg1)
 
 
virtual void ConnectNotify (string signal)
 
 
virtual void OnCustomEvent (QEvent arg1)
 
 
new void OnDestroyed (QObject arg1=null)
 
 
virtual void DisconnectNotify (string signal)
 
 
new int Receivers (string signal)
 
 
new QObject Sender ()
 
 
new int SenderSignalIndex ()
 
 
virtual void OnTimerEvent (QTimerEvent arg1)
 
 

Properties

virtual EventHandler
< QEventArgs< QEvent > > 
PostEvent
 
 
Slot Started
 
 
Slot Stopped
 
 
new string ErrorString [get]
 
 
new RestorePolicy GlobalRestorePolicy [get, set]
 
 
new bool Animated [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQStateMachineSignals Emit [get]
 
- Properties inherited from QtCore.QState
Slot Finished
 
 
Slot PropertiesAssigned
 
 
new QAbstractState InitialState [get, set]
 
new QAbstractState ErrorState [get, set]
 
new ChildMode childMode [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQStateSignals Emit [get]
 
- Properties inherited from QtCore.QAbstractState
Slot Entered
 
Slot Exited
 
static new QMetaObject StaticMetaObject [get]
 
new IQAbstractStateSignals Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
 
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
 
 
Slot< QObjectDestroyedQObject
 
Slot Destroyed
 
 
new QObject Parent [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 

Additional Inherited Members

- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QStateMachine class provides a hierarchical finite state machine.

QStateMachine is based on the concepts and notation of Statecharts. QStateMachine is part of The State Machine Framework.

A state machine manages a set of states (classes that inherit from QAbstractState) and transitions (descendants of QAbstractTransition) between those states; these states and transitions define a state graph. Once a state graph has been built, the state machine can execute it. QStateMachine's execution algorithm is based on the State Chart XML (SCXML) algorithm. The framework's overview gives several state graphs and the code to build them.

Use the addState() function to add a top-level state to the state machine. States are removed with the removeState() function. Removing states while the machine is running is discouraged.

Before the machine can be started, the initial state must be set. The initial state is the state that the machine enters when started. You can then start() the state machine. The started() signal is emitted when the initial state is entered.

The machine is event driven and keeps its own event loop. Events are posted to the machine through postEvent(). Note that this means that it executes asynchronously, and that it will not progress without a running event loop. You will normally not have to post events to the machine directly as Qt's transitions, e.g., QEventTransition and its subclasses, handle this. But for custom transitions triggered by events, postEvent() is useful.

The state machine processes events and takes transitions until a top-level final state is entered; the state machine then emits the finished() signal. You can also stop() the state machine explicitly. The stopped() signal is emitted in this case.

The following snippet shows a state machine that will finish when a button is clicked:

QPushButton button;

QStateMachine machine;

QState *s1 = new QState();

s1->assignProperty(&button, "text", "Click me");

QFinalState *s2 = new QFinalState();

s1->addTransition(&button, SIGNAL(clicked()), s2);

machine.addState(s1);

machine.addState(s2);

machine.setInitialState(s1);

machine.start();

This code example uses QState, which inherits QAbstractState. The QState class provides a state that you can use to set properties and invoke methods on QObjects when the state is entered or exited. It also contains convenience functions for adding transitions, e.g., QSignalTransitions as in this example. See the QState class description for further details.

If an error is encountered, the machine will look for an error state, and if one is available, it will enter this state. The types of errors possible are described by the Error enum. After the error state is entered, the type of the error can be retrieved with error(). The execution of the state graph will not stop when the error state is entered. If no error state applies to the erroneous state, the machine will stop executing and an error message will be printed to the console.

See also QAbstractState, QAbstractTransition, QState, and The State Machine Framework.

Member Enumeration Documentation

This enum type defines errors that can occur in the state machine at run time. When the state machine encounters an unrecoverable error at run time, it will set the error code returned by error(), the error message returned by errorString(), and enter an error state based on the context of the error.

See also setErrorState().

Enumerator:
NoCommonAncestorForTransitionError 

The machine has selected a transition whose source and targets are not part of the same tree of states, and thus are not part of the same state machine. Commonly, this could mean that one of the states has not been given any parent or added to any machine. The context of this error is the source state of the transition.

NoDefaultStateInHistoryStateError 

The machine has entered a QHistoryState which does not have a default state set. The context of this error is the QHistoryState which is missing a default state.

NoError 

No error has occurred.

NoInitialStateError 

The machine has entered a QState with children which does not have an initial state set. The context of this error is the state which is missing an initial state.

This enum type specifies the priority of an event posted to the state machine using postEvent().

Events of high priority are processed before events of normal priority.

Enumerator:
HighPriority 

The event has high priority.

NormalPriority 

The event has normal priority.

This enum specifies the restore policy type. The restore policy takes effect when the machine enters a state which sets one or more properties. If the restore policy 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 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.

See also QStateMachine::globalRestorePolicy and QState::assignProperty().

Enumerator:
DontRestoreProperties 

The state machine should not save the initial values of properties and restore them later.

RestoreProperties 

The state machine should save the initial values of properties and restore them later.

Constructor & Destructor Documentation

QtCore.QStateMachine.QStateMachine ( System.Type  dummy)
protected
QtCore.QStateMachine.QStateMachine ( QObject  parent = null)

Constructs a new state machine with the given parent.

Member Function Documentation

new void QtCore.QStateMachine.AddDefaultAnimation ( QAbstractAnimation  animation)

Adds a default animation to be considered for any transition.

new void QtCore.QStateMachine.AddState ( QAbstractState  state)

Adds the given state to this state machine. The state becomes a top-level state.

If the state is already in a different machine, it will first be removed from its old machine, and then added to this machine.

See also removeState() and setInitialState().

virtual void QtCore.QStateMachine.BeginMicrostep ( QEvent event)
protectedvirtual
virtual void QtCore.QStateMachine.BeginSelectTransitions ( QEvent event)
protectedvirtual
new void QtCore.QStateMachine.ClearError ( )

Clears the error string and error code of the state machine.

new System.Collections.Generic.List<QAbstractState> QtCore.QStateMachine.Configuration ( )

Returns the maximal consistent set of states (including parallel and final states) that this state machine is currently in. If a state s is in the configuration, it is always the case that the parent of s is also in c. Note, however, that the machine itself is not an explicit member of the configuration.

override void QtCore.QStateMachine.CreateProxy ( )
virtual

Reimplemented from QtCore.QState.

new System.Collections.Generic.List<QAbstractAnimation> QtCore.QStateMachine.DefaultAnimations ( )

Returns the list of default animations that will be considered for any transition.

new void QtCore.QStateMachine.Dispose ( )
virtual void QtCore.QStateMachine.EndMicrostep ( QEvent event)
protectedvirtual
virtual void QtCore.QStateMachine.EndSelectTransitions ( QEvent event)
protectedvirtual
new QStateMachine.Error QtCore.QStateMachine.error ( )

Returns the error code of the last error that occurred in the state machine.

override bool QtCore.QStateMachine.EventFilter ( QObject  watched,
QEvent event 
)

Reimplemented from QObject::eventFilter().

new bool QtCore.QStateMachine.IsRunning ( )

Returns whether this state machine is running.

start(), stop()

new bool QtCore.QStateMachine.OnCancelDelayedEvent ( int  id)

Cancels the delayed event identified by the given id. The id should be a value returned by a call to postDelayedEvent(). Returns true if the event was successfully cancelled, otherwise returns false.

Note: This function is thread-safe.

See also postDelayedEvent().

override void QtCore.QStateMachine.OnEntry ( QEvent event)
protectedvirtual

Reimplemented from QAbstractState::onEntry().

This function will call start() to start the state machine.

Reimplemented from QtCore.QState.

override bool QtCore.QStateMachine.OnEvent ( QEvent  e)
virtual

Reimplemented from QObject::event().

Reimplemented from QtCore.QState.

override void QtCore.QStateMachine.OnExit ( QEvent event)
protectedvirtual

Reimplemented from QAbstractState::onExit().

This function will call stop() to stop the state machine and subsequently emit the stopped() signal.

Reimplemented from QtCore.QState.

new int QtCore.QStateMachine.OnPostDelayedEvent ( QEvent event,
int  delay 
)

Posts the given event for processing by this state machine, with the given delay in milliseconds. Returns an identifier associated with the delayed event, or -1 if the event could not be posted.

This function returns immediately. When the delay has expired, the event will be added to the state machine's event queue for processing. The state machine takes ownership of the event and deletes it once it has been processed.

You can only post events when the state machine is running.

Note: This function is thread-safe.

See also cancelDelayedEvent() and postEvent().

new void QtCore.QStateMachine.OnPostEvent ( QEvent event)

Posts the given event of the given priority for processing by this state machine.

This function returns immediately. The event is added to the state machine's event queue. Events are processed in the order posted. The state machine takes ownership of the event and deletes it once it has been processed.

You can only post events when the state machine is running.

Note: This function is thread-safe.

See also postDelayedEvent().

new void QtCore.QStateMachine.OnPostEvent ( QEvent event,
QStateMachine.EventPriority  priority = QStateMachine.EventPriority.NormalPriority 
)

Posts the given event of the given priority for processing by this state machine.

This function returns immediately. The event is added to the state machine's event queue. Events are processed in the order posted. The state machine takes ownership of the event and deletes it once it has been processed.

You can only post events when the state machine is running.

Note: This function is thread-safe.

See also postDelayedEvent().

new void QtCore.QStateMachine.OnStarted ( )
protected

This signal is emitted when the state machine has entered its initial state (QStateMachine::initialState).

See also QStateMachine::finished() and QStateMachine::start().

new void QtCore.QStateMachine.OnStopped ( )
protected

This signal is emitted when the state machine has stopped.

See also QStateMachine::stop() and QStateMachine::finished().

new void QtCore.QStateMachine.RemoveDefaultAnimation ( QAbstractAnimation  animation)

Removes animation from the list of default animations.

new void QtCore.QStateMachine.RemoveState ( QAbstractState  state)

Removes the given state from this state machine. The state machine releases ownership of the state.

See also addState().

new void QtCore.QStateMachine.Start ( )

Starts this state machine. The machine will reset its configuration and transition to the initial state. When a final top-level state (QFinalState) is entered, the machine will emit the finished() signal.

Note: A state machine will not run without a running event loop, such as the main application event loop started with QCoreApplication::exec() or QApplication::exec().

See also started(), finished(), stop(), and initialState().

new void QtCore.QStateMachine.Stop ( )

Stops this state machine. The state machine will stop processing events and then emit the stopped() signal.

See also stopped() and start().

static string QtCore.QStateMachine.Tr ( string  s,
string  c = null 
)
static
static string QtCore.QStateMachine.Tr ( string  s,
string  c,
int  n 
)
static
static string QtCore.QStateMachine.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtCore.QStateMachine.TrUtf8 ( string  s,
string  c,
int  n 
)
static

Property Documentation

new bool QtCore.QStateMachine.Animated
getset

This property holds whether animations are enabled.

The default value of this property is true.

new IQStateMachineSignals QtCore.QStateMachine.Emit
getprotected
new string QtCore.QStateMachine.ErrorString
get

This property holds the error string of this state machine.

new RestorePolicy QtCore.QStateMachine.GlobalRestorePolicy
getset

This property holds the restore policy for states of this state machine.

The default value of this property is QStateMachine::DontRestoreProperties.

virtual EventHandler<QEventArgs<QEvent> > QtCore.QStateMachine.PostEvent
addremove

Posts the given event of the given priority for processing by this state machine.

This function returns immediately. The event is added to the state machine's event queue. Events are processed in the order posted. The state machine takes ownership of the event and deletes it once it has been processed.

You can only post events when the state machine is running.

Note: This function is thread-safe.

See also postDelayedEvent().

Slot QtCore.QStateMachine.Started
addremove

This signal is emitted when the state machine has entered its initial state (QStateMachine::initialState).

See also QStateMachine::finished() and QStateMachine::start().

new QMetaObject QtCore.QStateMachine.StaticMetaObject
staticget
Slot QtCore.QStateMachine.Stopped
addremove

This signal is emitted when the state machine has stopped.

See also QStateMachine::stop() and QStateMachine::finished().