[][src]Struct qt_core::QState

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

The QState class provides a general-purpose state for QStateMachine.

C++ class: QState.

C++ documentation:

The QState class provides a general-purpose state for QStateMachine.

QState objects can have child states, and can have transitions to other states. QState is part of The State Machine Framework.

The addTransition() function adds a transition. The removeTransition() function removes a transition. The transitions() function returns the state's outgoing transitions.

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

Top-level states must be passed a QStateMachine object as their parent state, or added to a state machine using QStateMachine::addState().

Methods

impl QState[src]

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 from_q_state(parent: impl CastInto<Ptr<QState>>) -> QBox<QState>[src]

Constructs a new state with the given parent state.

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

C++ documentation:

Constructs a new state with the given parent state.

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

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

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

C++ documentation:

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

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

The QState class provides a general-purpose state for QStateMachine.

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

C++ documentation:

The QState class provides a general-purpose state for QStateMachine.

QState objects can have child states, and can have transitions to other states. QState is part of The State Machine Framework.

The addTransition() function adds a transition. The removeTransition() function removes a transition. The transitions() function returns the state's outgoing transitions.

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

Top-level states must be passed a QStateMachine object as their parent state, or added to a state machine using QStateMachine::addState().

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

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

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

C++ documentation:

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

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 static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

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

Calls C++ function: static QString QState::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 QState::trUtf8(const char* s, const char* c, int n).

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

Methods from Deref<Target = QAbstractState>

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

This signal is emitted when the state has been entered (after onEntry() has been called).

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

C++ documentation:

This signal is emitted when the state has been entered (after onEntry() has been called).

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

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

This signal is emitted when the state has been exited (after onExit() has been called).

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

C++ documentation:

This signal is emitted when the state has been exited (after onExit() has been called).

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

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

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

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

C++ documentation:

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

This function was introduced in Qt 5.4.

Note: Notifier signal for property active.

See also QAbstractState::active, entered(), and exited().

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

This property holds the active property of this state. A state is active between entered() and exited() signals.

Calls C++ function: bool QAbstractState::active() const.

C++ documentation:

This property holds the active property of this state. A state is active between entered() and exited() signals.

This property was introduced in Qt 5.4.

Access functions:

bool active() const

Notifier signal:

void activeChanged(bool active)

pub unsafe fn machine(&self) -> QPtr<QStateMachine>[src]

Returns the state machine that this state is part of, or 0 if the state is not part of a state machine.

Calls C++ function: QStateMachine* QAbstractState::machine() const.

C++ documentation:

Returns the state machine that this state is part of, or 0 if the state is not part of a state machine.

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

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

pub unsafe fn parent_state(&self) -> QPtr<QState>[src]

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

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

C++ documentation:

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

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

Calls C++ function: virtual int QAbstractState::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* QAbstractState::qt_metacast(const char* arg1).

Trait Implementations

impl CppDeletable for QState[src]

unsafe fn delete(&self)[src]

Destroys this state.

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

C++ documentation:

Destroys this state.

impl Deref for QState[src]

type Target = QAbstractState

The resulting type after dereferencing.

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

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

impl DynamicCast<QState> for QAbstractState[src]

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

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

impl DynamicCast<QState> for QObject[src]

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

Calls C++ function: QState* dynamic_cast<QState*>(QObject* 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 StaticDowncast<QState> for QAbstractState[src]

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

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

impl StaticDowncast<QState> for QObject[src]

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

Calls C++ function: QState* static_cast<QState*>(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 StaticUpcast<QAbstractState> for QState[src]

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

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

impl StaticUpcast<QObject> for QState[src]

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

Calls C++ function: QObject* static_cast<QObject*>(QState* 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

impl RefUnwindSafe for QState

impl Send for QState

impl Sync for QState

impl Unpin for QState

impl UnwindSafe for QState

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.