Qyoto  4.0.7
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator 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)
  More...
 
override void CreateProxy ()
 
new void AddDefaultAnimation (QAbstractAnimation animation)
  More...
 
new void AddState (QAbstractState state)
  More...
 
new bool OnCancelDelayedEvent (int id)
  More...
 
new void ClearError ()
  More...
 
override bool OnEvent (QEvent e)
  More...
 
override bool EventFilter (QObject watched, QEvent @event)
  More...
 
new int OnPostDelayedEvent (QEvent @event, int delay)
  More...
 
new void OnPostEvent (QEvent @event)
  More...
 
new void OnPostEvent (QEvent @event, QStateMachine.EventPriority priority=QStateMachine.EventPriority.NormalPriority)
  More...
 
new void RemoveDefaultAnimation (QAbstractAnimation animation)
  More...
 
new void RemoveState (QAbstractState state)
  More...
 
new void Start ()
  More...
 
new void Stop ()
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QState
 QState (QState parent=null)
  More...
 
 QState (QState.ChildMode childMode, QState parent=null)
  More...
 
new void AddTransition (QAbstractTransition transition)
  More...
 
new QAbstractTransition AddTransition (QAbstractState target)
  More...
 
new QSignalTransition AddTransition (QObject sender, string signal, QAbstractState target)
  More...
 
new void AssignProperty (QObject @object, string name, object value)
  More...
 
new void RemoveTransition (QAbstractTransition transition)
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QAbstractState
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
  More...
 
new bool BlockSignals (bool b)
  More...
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
  More...
 
new void DeleteLater ()
  More...
 
new bool Disconnect (QObject receiver, string member=null)
  More...
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
  More...
 
new void DumpObjectInfo ()
  More...
 
new void DumpObjectTree ()
  More...
 
new bool Inherits (string classname)
  More...
 
new void InstallEventFilter (QObject filterObj)
  More...
 
new void KillTimer (int id)
  More...
 
new object Property (string name)
  More...
 
new void RemoveEventFilter (QObject obj)
  More...
 
new bool SetProperty (string name, object value)
  More...
 
new void SetUserData (uint id, QObjectUserData data)
 
new int StartTimer (int interval)
  More...
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 

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)
  More...
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
  More...
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
  More...
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
  More...
 
static string Tr (string s, string c=null)
  More...
 
static string Tr (string s, string c, int n)
  More...
 
static string TrUtf8 (string s, string c=null)
  More...
 
static string TrUtf8 (string s, string c, int n)
  More...
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream stream, QSizeF size)
  More...
 
static QDataStream Write (QDataStream stream, QPoint point)
  More...
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream stream, QLineF line)
  More...
 
static QDataStream Write (QDataStream stream, QPointF point)
  More...
 
static QDataStream Write (QDataStream @out, QChar chr)
  More...
 
static QDataStream Write (QDataStream @out, QByteArray ba)
  More...
 
static QDataStream Write (QDataStream stream, QEasingCurve easing)
  More...
 
static QDataStream Write (QDataStream stream, QRectF rectangle)
  More...
 
static QDataStream Write (QDataStream @out, QDateTime dateTime)
  More...
 
static QDataStream Write (QDataStream @out, QUrl url)
  More...
 
static QDataStream Write (QDataStream @out, QTime time)
  More...
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream @out, QBitArray ba)
  More...
 
static QDataStream Write (QDataStream s, QUuid id)
  More...
 
static QDataStream Write (QDataStream stream, QLine line)
  More...
 
static QDataStream Write (QDataStream @out, QDate date)
  More...
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
  More...
 
static QDataStream Write (QDataStream stream, QRect rectangle)
  More...
 
static QDataStream Write (QDataStream stream, QSize size)
  More...
 
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)
  More...
 
static QDataStream Read (QDataStream @in, QChar chr)
  More...
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream stream, QRect rectangle)
  More...
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream @in, QDate date)
  More...
 
static QDataStream Read (QDataStream @in, QUrl url)
  More...
 
static QDataStream Read (QDataStream s, QUuid id)
  More...
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream stream, QLineF line)
  More...
 
static QDataStream Read (QDataStream stream, QRectF rectangle)
  More...
 
static QDataStream Read (QDataStream stream, QPointF point)
  More...
 
static QDataStream Read (QDataStream stream, QLine line)
  More...
 
static QDataStream Read (QDataStream @in, QBitArray ba)
  More...
 
static QDataStream Read (QDataStream stream, QSize size)
  More...
 
static QDataStream Read (QDataStream @in, QDateTime dateTime)
  More...
 
static QDataStream Read (QDataStream @in, QTime time)
  More...
 
static QDataStream Read (QDataStream stream, QPoint point)
  More...
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
  More...
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream @in, QByteArray ba)
  More...
 
static QDataStream Read (QDataStream stream, QSizeF size)
  More...
 
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)
  More...
 
static double QAcos (double v)
  More...
 
static void QAddPostRoutine (System.Action ptr)
  More...
 
static double QAsin (double v)
  More...
 
static double QAtan (double v)
  More...
 
static double QAtan2 (double x, double y)
  More...
 
static void QBadAlloc ()
 
static int QCeil (double v)
  More...
 
static ushort QChecksum (string s, uint len)
  More...
 
static QByteArray QCompress (QByteArray data, int compressionLevel=-1)
  More...
 
static QByteArray QCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
  More...
 
static double QCos (double v)
  More...
 
static double QExp (double v)
  More...
 
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)
  More...
 
static bool QFuzzyCompare (double p1, double p2)
  More...
 
static bool QFuzzyCompare (float p1, float p2)
  More...
 
static bool QFuzzyIsNull (double d)
 
static bool QFuzzyIsNull (float f)
 
static uint QHash (QBitArray key)
  More...
 
static uint QHash (QChar key)
  More...
 
static uint QHash (QStringRef key)
 
static uint QHash (QUrl url)
  More...
 
static uint QHash (QPersistentModelIndex index)
 
static uint QHash (QByteArray key)
  More...
 
static uint QHash (QModelIndex index)
 
static uint QHash (uint key)
  More...
 
static uint QHash (char key)
  More...
 
static uint QHash (byte key)
  More...
 
static uint QHash (short key)
  More...
 
static uint QHash (NativeLong key)
  More...
 
static uint QHash (ushort key)
  More...
 
static uint QHash (long key)
  More...
 
static uint QHash (ulong key)
  More...
 
static uint QHash (int key)
  More...
 
static uint QHash (string key)
  More...
 
static uint QHash (NativeULong key)
  More...
 
static Qt.ActionQtMsgTypeString QInstallMsgHandler (Qt.ActionQtMsgTypeString handler)
  More...
 
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)
  More...
 
static double QPow (double x, double y)
  More...
 
static void QRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
  More...
 
static void QRemovePostRoutine (System.Action arg1)
 
static int QRound (double d)
  More...
 
static long QRound64 (double d)
  More...
 
static double QSin (double v)
  More...
 
static double QSqrt (double v)
  More...
 
static bool QStringComparisonHelper (QStringRef s1, string s2)
 
static double QTan (double v)
  More...
 
static QByteArray QUncompress (QByteArray data)
  More...
 
static QByteArray QUncompress (Pointer< byte > data, int nbytes)
  More...
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
  More...
 
static bool Qputenv (string varName, QByteArray value)
  More...
 
static void Qsrand (uint seed)
  More...
 
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)
  More...
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
  More...
 
static Pointer< sbyte > Qstrdup (string src)
  More...
 
static int Qstricmp (string str1, string str2)
  More...
 
static uint Qstrlen (string str)
  More...
 
static int Qstrncmp (string str1, string str2, uint len)
  More...
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
  More...
 
static int Qstrnicmp (string str1, string str2, uint len)
  More...
 
static uint Qstrnlen (string str, uint maxlen)
  More...
 

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)
  More...
 
override void OnExit (QEvent @event)
  More...
 
new void OnStarted ()
  More...
 
new void OnStopped ()
  More...
 
- Protected Member Functions inherited from QtCore.QState
 QState (System.Type dummy)
 
new void OnFinished ()
  More...
 
new void OnPropertiesAssigned ()
  More...
 
- Protected Member Functions inherited from QtCore.QAbstractState
 QAbstractState (System.Type dummy)
 
 QAbstractState (QState parent=null)
  More...
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void OnChildEvent (QChildEvent @event)
  More...
 
virtual void ConnectNotify (string signal)
  More...
 
virtual void OnCustomEvent (QEvent @event)
  More...
 
new void OnDestroyed (QObject obj=null)
  More...
 
virtual void DisconnectNotify (string signal)
  More...
 
new int Receivers (string signal)
  More...
 
virtual void OnTimerEvent (QTimerEvent @event)
  More...
 

Properties

virtual EventHandler
< QEventArgs< QEvent > > 
PostEvent
  More...
 
Slot Started
  More...
 
Slot Stopped
  More...
 
System.Collections.Generic.HashSet
< QAbstractState
Configuration [get]
  More...
 
System.Collections.Generic.List
< QAbstractAnimation
DefaultAnimations [get]
  More...
 
QStateMachine.Error error [get]
  More...
 
bool IsRunning [get]
  More...
 
new string ErrorString [get]
  More...
 
new RestorePolicy GlobalRestorePolicy [get, set]
  More...
 
new bool Animated [get, set]
  More...
 
static new QMetaObject StaticMetaObject [get]
 
new IQStateMachineSignals Emit [get]
 
- Properties inherited from QtCore.QState
Slot Finished
  More...
 
Slot PropertiesAssigned
  More...
 
System.Collections.Generic.List
< QAbstractTransition
Transitions [get]
  More...
 
new QAbstractState InitialState [get, set]
  More...
 
new QAbstractState ErrorState [get, set]
  More...
 
new ChildMode childMode [get, set]
  More...
 
static new QMetaObject StaticMetaObject [get]
 
new IQStateSignals Emit [get]
 
- Properties inherited from QtCore.QAbstractState
Slot Entered
  More...
 
Slot Exited
  More...
 
QStateMachine Machine [get]
  More...
 
QState ParentState [get]
  More...
 
static new QMetaObject StaticMetaObject [get]
 
new IQAbstractStateSignals Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
  More...
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
  More...
 
Slot< QObjectDestroyedObj
  More...
 
Slot Destroyed
  More...
 
QObject Parent [get, set]
  More...
 
System.Collections.Generic.List
< QObject
Children [get]
  More...
 
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames [get]
  More...
 
bool IsWidgetType [get]
  More...
 
static uint RegisterUserData [get]
 
QObject Sender [get]
  More...
 
int SenderSignalIndex [get]
  More...
 
bool SignalsBlocked [get]
  More...
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
  More...
 
static new QMetaObject StaticMetaObject [get]
  More...
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 
- Properties inherited from QtCore.Qt
static string QAppName [get]
 
static double QInf [get]
 
static double QQNaN [get]
 
static double QSNaN [get]
 
static bool QSharedBuild [get]
 
static string QVersion [get]
  More...
 
static int Qrand [get]
  More...
 

Additional Inherited Members

- Static Public Attributes inherited from QtCore.Qt
</para > *< para > Creating QM
files suitable for use with
this[SmokeMethod("qtTrId(const
char*, int)")] static strin 
QtTrId )(string id, int n=-1)
 
- 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.

Here is the call graph for this function:

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.

override void QtCore.QStateMachine.CreateProxy ( )
virtual

Reimplemented from QtCore.QState.

Here is the caller graph for this function:

new void QtCore.QStateMachine.Dispose ( )
virtual void QtCore.QStateMachine.EndMicrostep ( QEvent event)
protectedvirtual
virtual void QtCore.QStateMachine.EndSelectTransitions ( QEvent event)
protectedvirtual
override bool QtCore.QStateMachine.EventFilter ( QObject  watched,
QEvent event 
)
virtual

Reimplemented from QObject::eventFilter().

Reimplemented from QtCore.QObject.

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.

System.Collections.Generic.HashSet<QAbstractState> QtCore.QStateMachine.Configuration
get

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.

System.Collections.Generic.List<QAbstractAnimation> QtCore.QStateMachine.DefaultAnimations
get

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

new IQStateMachineSignals QtCore.QStateMachine.Emit
getprotected
QStateMachine.Error QtCore.QStateMachine.error
get

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

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.

bool QtCore.QStateMachine.IsRunning
get

Returns whether this state machine is running.

start(), stop()

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