[][src]Struct qt_core::QStateMachine

#[repr(C)]pub struct QStateMachine { /* fields omitted */ }

The QStateMachine class provides a hierarchical finite state machine.

C++ class: QStateMachine.

C++ documentation:

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.

Methods

impl QStateMachine[src]

pub fn slot_start(&self) -> Receiver<()>[src]

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.

Returns a built-in Qt slot QStateMachine::start that can be passed to qt_core::Signal::connect.

C++ documentation:

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(), initialState(), and setRunning().

pub fn slot_stop(&self) -> Receiver<()>[src]

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

Returns a built-in Qt slot QStateMachine::stop that can be passed to qt_core::Signal::connect.

C++ documentation:

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

See also stopped(), start(), and setRunning().

pub fn slot_set_running(&self) -> Receiver<(bool,)>[src]

This property holds the running state of this state machine

Returns a built-in Qt slot QStateMachine::setRunning that can be passed to qt_core::Signal::connect.

C++ documentation:

This property holds the running state of this state machine

This property was introduced in Qt 5.4.

Access functions:

bool isRunning() const
void setRunning(bool running)

Notifier signal:

void runningChanged(bool running)

See also start(), stop(), started(), stopped(), and runningChanged().

pub fn started(&self) -> Signal<()>[src]

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

Returns a built-in Qt signal QStateMachine::started that can be passed to qt_core::Signal::connect.

C++ documentation:

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

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

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

pub fn stopped(&self) -> Signal<()>[src]

This signal is emitted when the state machine has stopped.

Returns a built-in Qt signal QStateMachine::stopped that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the state machine has stopped.

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

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

pub fn running_changed(&self) -> Signal<(bool,)>[src]

This signal is emitted when the running property is changed with running as argument.

Returns a built-in Qt signal QStateMachine::runningChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the running property is changed with running as argument.

This function was introduced in Qt 5.4.

Note: Notifier signal for property running.

See also QStateMachine::running.

pub unsafe fn add_default_animation(
    &self,
    animation: impl CastInto<Ptr<QAbstractAnimation>>
)
[src]

Adds a default animation to be considered for any transition.

Calls C++ function: void QStateMachine::addDefaultAnimation(QAbstractAnimation* animation).

C++ documentation:

Adds a default animation to be considered for any transition.

pub unsafe fn add_state(&self, state: impl CastInto<Ptr<QAbstractState>>)[src]

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

Calls C++ function: void QStateMachine::addState(QAbstractState* state).

C++ documentation:

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

pub unsafe fn cancel_delayed_event(&self, id: c_int) -> bool[src]

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.

Calls C++ function: bool QStateMachine::cancelDelayedEvent(int id).

C++ documentation:

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

pub unsafe fn clear_error(&self)[src]

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

Calls C++ function: void QStateMachine::clearError().

C++ documentation:

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

pub unsafe fn configuration(&self) -> CppBox<QSetOfQAbstractState>[src]

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.

Calls C++ function: QSet<QAbstractState*> QStateMachine::configuration() const.

C++ documentation:

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.

pub unsafe fn default_animations(&self) -> CppBox<QListOfQAbstractAnimation>[src]

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

Calls C++ function: QList<QAbstractAnimation*> QStateMachine::defaultAnimations() const.

C++ documentation:

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

pub unsafe fn error(&self) -> Error[src]

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

Calls C++ function: QStateMachine::Error QStateMachine::error() const.

C++ documentation:

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

pub unsafe fn error_string(&self) -> CppBox<QString>[src]

This property holds the error string of this state machine

Calls C++ function: QString QStateMachine::errorString() const.

C++ documentation:

This property holds the error string of this state machine

Access functions:

QString errorString() const

pub unsafe fn event_filter(
    &self,
    watched: impl CastInto<Ptr<QObject>>,
    event: impl CastInto<Ptr<QEvent>>
) -> bool
[src]

Reimplemented from QObject::eventFilter().

Calls C++ function: virtual bool QStateMachine::eventFilter(QObject* watched, QEvent* event).

C++ documentation:

Reimplemented from QObject::eventFilter().

pub unsafe fn global_restore_policy(&self) -> RestorePolicy[src]

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

Calls C++ function: QState::RestorePolicy QStateMachine::globalRestorePolicy() const.

C++ documentation:

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

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

Access functions:

QState::RestorePolicy globalRestorePolicy() const
void setGlobalRestorePolicy(QState::RestorePolicy restorePolicy)

pub unsafe fn is_animated(&self) -> bool[src]

Returns whether animations are enabled for this state machine.

Calls C++ function: bool QStateMachine::isAnimated() const.

C++ documentation:

Returns whether animations are enabled for this state machine.

Note: Getter function for property animated.

pub unsafe fn is_running(&self) -> bool[src]

This property holds the running state of this state machine

Calls C++ function: bool QStateMachine::isRunning() const.

C++ documentation:

This property holds the running state of this state machine

This property was introduced in Qt 5.4.

Access functions:

bool isRunning() const
void setRunning(bool running)

Notifier signal:

void runningChanged(bool running)

See also start(), stop(), started(), stopped(), and runningChanged().

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QStateMachine::metaObject() const.

pub unsafe fn from_q_object(
    parent: impl CastInto<Ptr<QObject>>
) -> QBox<QStateMachine>
[src]

Constructs a new state machine with the given parent.

Calls C++ function: [constructor] void QStateMachine::QStateMachine(QObject* parent = …).

C++ documentation:

Constructs a new state machine with the given parent.

pub unsafe fn from_child_mode_q_object(
    child_mode: ChildMode,
    parent: impl CastInto<Ptr<QObject>>
) -> QBox<QStateMachine>
[src]

Constructs a new state machine with the given childMode and parent.

Calls C++ function: [constructor] void QStateMachine::QStateMachine(QState::ChildMode childMode, QObject* parent = …).

C++ documentation:

Constructs a new state machine with the given childMode and parent.

This function was introduced in Qt 5.0.

pub unsafe fn new() -> QBox<QStateMachine>[src]

The QStateMachine class provides a hierarchical finite state machine.

Calls C++ function: [constructor] void QStateMachine::QStateMachine().

C++ documentation:

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.

pub unsafe fn from_child_mode(child_mode: ChildMode) -> QBox<QStateMachine>[src]

Constructs a new state machine with the given childMode and parent.

Calls C++ function: [constructor] void QStateMachine::QStateMachine(QState::ChildMode childMode).

C++ documentation:

Constructs a new state machine with the given childMode and parent.

This function was introduced in Qt 5.0.

pub unsafe fn post_delayed_event(
    &self,
    event: impl CastInto<Ptr<QEvent>>,
    delay: c_int
) -> c_int
[src]

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.

Calls C++ function: int QStateMachine::postDelayedEvent(QEvent* event, int delay).

C++ documentation:

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

pub unsafe fn post_event_2a(
    &self,
    event: impl CastInto<Ptr<QEvent>>,
    priority: EventPriority
)
[src]

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

Calls C++ function: void QStateMachine::postEvent(QEvent* event, QStateMachine::EventPriority priority = …).

C++ documentation:

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 or when it is starting up.

Note: This function is thread-safe.

See also postDelayedEvent().

pub unsafe fn post_event_1a(&self, event: impl CastInto<Ptr<QEvent>>)[src]

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

Calls C++ function: void QStateMachine::postEvent(QEvent* event).

C++ documentation:

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 or when it is starting up.

Note: This function is thread-safe.

See also postDelayedEvent().

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QStateMachine::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QStateMachine::qt_metacast(const char* arg1).

pub unsafe fn remove_default_animation(
    &self,
    animation: impl CastInto<Ptr<QAbstractAnimation>>
)
[src]

Removes animation from the list of default animations.

Calls C++ function: void QStateMachine::removeDefaultAnimation(QAbstractAnimation* animation).

C++ documentation:

Removes animation from the list of default animations.

pub unsafe fn remove_state(&self, state: impl CastInto<Ptr<QAbstractState>>)[src]

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

Calls C++ function: void QStateMachine::removeState(QAbstractState* state).

C++ documentation:

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

See also addState().

pub unsafe fn set_animated(&self, enabled: bool)[src]

Sets whether animations are enabled for this state machine.

Calls C++ function: void QStateMachine::setAnimated(bool enabled).

C++ documentation:

Sets whether animations are enabled for this state machine.

Note: Setter function for property animated.

See also isAnimated().

pub unsafe fn set_global_restore_policy(&self, restore_policy: RestorePolicy)[src]

Sets the restore policy of the state machine to restorePolicy. The default restore policy is QState::DontRestoreProperties.

Calls C++ function: void QStateMachine::setGlobalRestorePolicy(QState::RestorePolicy restorePolicy).

C++ documentation:

Sets the restore policy of the state machine to restorePolicy. The default restore policy is QState::DontRestoreProperties.

Note: Setter function for property globalRestorePolicy.

See also globalRestorePolicy().

pub unsafe fn set_running(&self, running: bool)[src]

This property holds the running state of this state machine

Calls C++ function: [slot] void QStateMachine::setRunning(bool running).

C++ documentation:

This property holds the running state of this state machine

This property was introduced in Qt 5.4.

Access functions:

bool isRunning() const
void setRunning(bool running)

Notifier signal:

void runningChanged(bool running)

See also start(), stop(), started(), stopped(), and runningChanged().

pub unsafe fn start(&self)[src]

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.

Calls C++ function: [slot] void QStateMachine::start().

C++ documentation:

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(), initialState(), and setRunning().

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn stop(&self)[src]

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

Calls C++ function: [slot] void QStateMachine::stop().

C++ documentation:

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

See also stopped(), start(), and setRunning().

pub unsafe fn tr(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QStateMachine::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QStateMachine::trUtf8(const char* s, const char* c, int n).

Methods from Deref<Target = QState>

pub fn finished(&self) -> Signal<()>[src]

This signal is emitted when a final child state of this state is entered.

Returns a built-in Qt signal QState::finished that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when a final child state of this state is entered.

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

See also QFinalState.

pub fn properties_assigned(&self) -> Signal<()>[src]

This signal is emitted when all properties have been assigned their final value. If the state assigns a value to one or more properties for which an animation exists (either set on the transition or as a default animation on the state machine), then the signal will not be emitted until all such animations have finished playing.

Returns a built-in Qt signal QState::propertiesAssigned that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when all properties have been assigned their final value. If the state assigns a value to one or more properties for which an animation exists (either set on the transition or as a default animation on the state machine), then the signal will not be emitted until all such animations have finished playing.

If there are no relevant animations, or no property assignments defined for the state, then the signal will be emitted immediately before the state is entered.

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

See also QState::assignProperty() and QAbstractTransition::addAnimation().

pub fn child_mode_changed(&self) -> Signal<()>[src]

This signal is emitted when the childMode property is changed.

Returns a built-in Qt signal QState::childModeChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the childMode property is changed.

This function was introduced in Qt 5.4.

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

Note: Notifier signal for property childMode.

See also QState::childMode.

pub fn initial_state_changed(&self) -> Signal<()>[src]

This signal is emitted when the initialState property is changed.

Returns a built-in Qt signal QState::initialStateChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the initialState property is changed.

This function was introduced in Qt 5.4.

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

Note: Notifier signal for property initialState.

See also QState::initialState.

pub fn error_state_changed(&self) -> Signal<()>[src]

This signal is emitted when the errorState property is changed.

Returns a built-in Qt signal QState::errorStateChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the errorState property is changed.

This function was introduced in Qt 5.4.

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

Note: Notifier signal for property errorState.

See also QState::errorState.

pub unsafe fn add_transition_q_abstract_transition(
    &self,
    transition: impl CastInto<Ptr<QAbstractTransition>>
)
[src]

Adds the given transition. The transition has this state as the source. This state takes ownership of the transition.

Calls C++ function: void QState::addTransition(QAbstractTransition* transition).

C++ documentation:

Adds the given transition. The transition has this state as the source. This state takes ownership of the transition.

pub unsafe fn add_transition_q_object_char_q_abstract_state(
    &self,
    sender: impl CastInto<Ptr<QObject>>,
    signal: *const c_char,
    target: impl CastInto<Ptr<QAbstractState>>
) -> QPtr<QSignalTransition>
[src]

Adds a transition associated with the given signal of the given sender object, and returns the new QSignalTransition object. The transition has this state as the source, and the given target as the target state.

Calls C++ function: QSignalTransition* QState::addTransition(const QObject* sender, const char* signal, QAbstractState* target).

C++ documentation:

Adds a transition associated with the given signal of the given sender object, and returns the new QSignalTransition object. The transition has this state as the source, and the given target as the target state.

pub unsafe fn add_transition_q_abstract_state(
    &self,
    target: impl CastInto<Ptr<QAbstractState>>
) -> QPtr<QAbstractTransition>
[src]

Adds an unconditional transition from this state to the given target state, and returns then new transition object.

Calls C++ function: QAbstractTransition* QState::addTransition(QAbstractState* target).

C++ documentation:

Adds an unconditional transition from this state to the given target state, and returns then new transition object.

pub unsafe fn assign_property(
    &self,
    object: impl CastInto<Ptr<QObject>>,
    name: *const c_char,
    value: impl CastInto<Ref<QVariant>>
)
[src]

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

Calls C++ function: void QState::assignProperty(QObject* object, const char* name, const QVariant& value).

C++ documentation:

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

See also propertiesAssigned().

pub unsafe fn child_mode(&self) -> ChildMode[src]

This property holds the child mode of this state

Calls C++ function: QState::ChildMode QState::childMode() const.

C++ documentation:

This property holds the child mode of this state

The default value of this property is QState::ExclusiveStates.

Access functions:

ChildMode childMode() const
void setChildMode(ChildMode mode)

Notifier signal:

void childModeChanged()[see note below]

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

pub unsafe fn error_state(&self) -> QPtr<QAbstractState>[src]

This property holds the error state of this state

Calls C++ function: QAbstractState* QState::errorState() const.

C++ documentation:

This property holds the error state of this state

Access functions:

QAbstractState *errorState() const
void setErrorState(QAbstractState *state)

Notifier signal:

void errorStateChanged()[see note below]

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

pub unsafe fn initial_state(&self) -> QPtr<QAbstractState>[src]

This property holds the initial state of this state (one of its child states)

Calls C++ function: QAbstractState* QState::initialState() const.

C++ documentation:

This property holds the initial state of this state (one of its child states)

Access functions:

QAbstractState *initialState() const
void setInitialState(QAbstractState *state)

Notifier signal:

void initialStateChanged()[see note below]

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QState::metaObject() const.

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QState::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QState::qt_metacast(const char* arg1).

pub unsafe fn remove_transition(
    &self,
    transition: impl CastInto<Ptr<QAbstractTransition>>
)
[src]

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

Calls C++ function: void QState::removeTransition(QAbstractTransition* transition).

C++ documentation:

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

See also addTransition().

pub unsafe fn set_child_mode(&self, mode: ChildMode)[src]

Sets the child mode of this state.

Calls C++ function: void QState::setChildMode(QState::ChildMode mode).

C++ documentation:

Sets the child mode of this state.

Note: Setter function for property childMode.

See also childMode().

pub unsafe fn set_error_state(&self, state: impl CastInto<Ptr<QAbstractState>>)[src]

Sets this state's error state to be the given state. If the error state is not set, or if it is set to 0, the state will inherit its parent's error state recursively. If no error state is set for the state itself or any of its ancestors, an error will cause the machine to stop executing and an error will be printed to the console.

Calls C++ function: void QState::setErrorState(QAbstractState* state).

C++ documentation:

Sets this state's error state to be the given state. If the error state is not set, or if it is set to 0, the state will inherit its parent's error state recursively. If no error state is set for the state itself or any of its ancestors, an error will cause the machine to stop executing and an error will be printed to the console.

Note: Setter function for property errorState.

See also errorState().

pub unsafe fn set_initial_state(
    &self,
    state: impl CastInto<Ptr<QAbstractState>>
)
[src]

Sets this state's initial state to be the given state. state has to be a child of this state.

Calls C++ function: void QState::setInitialState(QAbstractState* state).

C++ documentation:

Sets this state's initial state to be the given state. state has to be a child of this state.

Note: Setter function for property initialState.

See also initialState().

pub unsafe fn transitions(&self) -> CppBox<QListOfQAbstractTransition>[src]

Returns this state's outgoing transitions (i.e. transitions where this state is the source state), or an empty list if this state has no outgoing transitions.

Calls C++ function: QList<QAbstractTransition*> QState::transitions() const.

C++ documentation:

Returns this state's outgoing transitions (i.e. transitions where this state is the source state), or an empty list if this state has no outgoing transitions.

This function was introduced in Qt 4.7.

See also addTransition().

Trait Implementations

impl CppDeletable for QStateMachine[src]

unsafe fn delete(&self)[src]

Destroys this state machine.

Calls C++ function: virtual [destructor] void QStateMachine::~QStateMachine().

C++ documentation:

Destroys this state machine.

impl Deref for QStateMachine[src]

type Target = QState

The resulting type after dereferencing.

fn deref(&self) -> &QState[src]

Calls C++ function: QState* static_cast<QState*>(QStateMachine* ptr).

impl DynamicCast<QStateMachine> for QState[src]

unsafe fn dynamic_cast(ptr: Ptr<QState>) -> Ptr<QStateMachine>[src]

Calls C++ function: QStateMachine* dynamic_cast<QStateMachine*>(QState* ptr).

impl DynamicCast<QStateMachine> for QAbstractState[src]

unsafe fn dynamic_cast(ptr: Ptr<QAbstractState>) -> Ptr<QStateMachine>[src]

Calls C++ function: QStateMachine* dynamic_cast<QStateMachine*>(QAbstractState* ptr).

impl DynamicCast<QStateMachine> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QStateMachine>[src]

Calls C++ function: QStateMachine* dynamic_cast<QStateMachine*>(QObject* ptr).

impl StaticDowncast<QStateMachine> for QState[src]

unsafe fn static_downcast(ptr: Ptr<QState>) -> Ptr<QStateMachine>[src]

Calls C++ function: QStateMachine* static_cast<QStateMachine*>(QState* ptr).

impl StaticDowncast<QStateMachine> for QAbstractState[src]

unsafe fn static_downcast(ptr: Ptr<QAbstractState>) -> Ptr<QStateMachine>[src]

Calls C++ function: QStateMachine* static_cast<QStateMachine*>(QAbstractState* ptr).

impl StaticDowncast<QStateMachine> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QStateMachine>[src]

Calls C++ function: QStateMachine* static_cast<QStateMachine*>(QObject* ptr).

impl StaticUpcast<QAbstractState> for QStateMachine[src]

unsafe fn static_upcast(ptr: Ptr<QStateMachine>) -> Ptr<QAbstractState>[src]

Calls C++ function: QAbstractState* static_cast<QAbstractState*>(QStateMachine* ptr).

impl StaticUpcast<QObject> for QStateMachine[src]

unsafe fn static_upcast(ptr: Ptr<QStateMachine>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QStateMachine* ptr).

impl StaticUpcast<QState> for QStateMachine[src]

unsafe fn static_upcast(ptr: Ptr<QStateMachine>) -> Ptr<QState>[src]

Calls C++ function: QState* static_cast<QState*>(QStateMachine* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.