[][src]Struct qt_core::QHistoryState

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

The QHistoryState class provides a means of returning to a previously active substate.

C++ class: QHistoryState.

C++ documentation:

The QHistoryState class provides a means of returning to a previously active substate.

A history state is a pseudo-state that represents the child state that the parent state was in the last time the parent state was exited. A transition with a history state as its target is in fact a transition to one or more other child states of the parent state. QHistoryState is part of The State Machine Framework.

Use the setDefaultState() function to set the state that should be entered if the parent state has never been entered. Example:

QStateMachine machine;

QState s1 = new QState(); QState s11 = new QState(s1); QState *s12 = new QState(s1);

QHistoryState *s1h = new QHistoryState(s1); s1h->setDefaultState(s11);

machine.addState(s1);

QState *s2 = new QState(); machine.addState(s2);

QPushButton *button = new QPushButton(); // Clicking the button will cause the state machine to enter the child state // that s1 was in the last time s1 was exited, or the history state's default // state if s1 has never been entered. s1->addTransition(button, SIGNAL(clicked()), s1h);

If more than one default state has to be entered, or if the transition to the default state(s) has to be acted upon, the defaultTransition should be set instead. Note that the eventTest() method of that transition will never be called: the selection and execution of the transition is done automatically when entering the history state.

By default a history state is shallow, meaning that it won't remember nested states. This can be configured through the historyType property.

Methods

impl QHistoryState[src]

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

This signal is emitted when the defaultTransition property is changed.

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

C++ documentation:

This signal is emitted when the defaultTransition property is changed.

This function was introduced in Qt 5.6.

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 defaultTransition.

See also QHistoryState::defaultTransition.

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

This signal is emitted when the defaultState property is changed.

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

C++ documentation:

This signal is emitted when the defaultState 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 defaultState.

See also QHistoryState::defaultState.

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

This signal is emitted when the historyType property is changed.

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

C++ documentation:

This signal is emitted when the historyType 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 historyType.

See also QHistoryState::historyType.

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

This property holds the default state of this history state

Calls C++ function: QAbstractState* QHistoryState::defaultState() const.

C++ documentation:

This property holds the default state of this history state

Access functions:

QAbstractState *defaultState() const
void setDefaultState(QAbstractState *state)

Notifier signal:

void defaultStateChanged()[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 default_transition(&self) -> QPtr<QAbstractTransition>[src]

This property holds the default transition of this history state

Calls C++ function: QAbstractTransition* QHistoryState::defaultTransition() const.

C++ documentation:

This property holds the default transition of this history state

Access functions:

QAbstractTransition *defaultTransition() const
void setDefaultTransition(QAbstractTransition *transition)

Notifier signal:

void defaultTransitionChanged()[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 history_type(&self) -> HistoryType[src]

This property holds the type of history that this history state records

Calls C++ function: QHistoryState::HistoryType QHistoryState::historyType() const.

C++ documentation:

This property holds the type of history that this history state records

The default value of this property is QHistoryState::ShallowHistory.

Access functions:

HistoryType historyType() const
void setHistoryType(HistoryType type)

Notifier signal:

void historyTypeChanged()[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* QHistoryState::metaObject() const.

pub unsafe fn from_q_state(
    parent: impl CastInto<Ptr<QState>>
) -> QBox<QHistoryState>
[src]

Constructs a new shallow history state with the given parent state.

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

C++ documentation:

Constructs a new shallow history state with the given parent state.

pub unsafe fn from_history_type_q_state(
    type_: HistoryType,
    parent: impl CastInto<Ptr<QState>>
) -> QBox<QHistoryState>
[src]

Constructs a new history state of the given type, with the given parent state.

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

C++ documentation:

Constructs a new history state of the given type, with the given parent state.

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

The QHistoryState class provides a means of returning to a previously active substate.

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

C++ documentation:

The QHistoryState class provides a means of returning to a previously active substate.

A history state is a pseudo-state that represents the child state that the parent state was in the last time the parent state was exited. A transition with a history state as its target is in fact a transition to one or more other child states of the parent state. QHistoryState is part of The State Machine Framework.

Use the setDefaultState() function to set the state that should be entered if the parent state has never been entered. Example:

QStateMachine machine;

QState s1 = new QState(); QState s11 = new QState(s1); QState *s12 = new QState(s1);

QHistoryState *s1h = new QHistoryState(s1); s1h->setDefaultState(s11);

machine.addState(s1);

QState *s2 = new QState(); machine.addState(s2);

QPushButton *button = new QPushButton(); // Clicking the button will cause the state machine to enter the child state // that s1 was in the last time s1 was exited, or the history state's default // state if s1 has never been entered. s1->addTransition(button, SIGNAL(clicked()), s1h);

If more than one default state has to be entered, or if the transition to the default state(s) has to be acted upon, the defaultTransition should be set instead. Note that the eventTest() method of that transition will never be called: the selection and execution of the transition is done automatically when entering the history state.

By default a history state is shallow, meaning that it won't remember nested states. This can be configured through the historyType property.

pub unsafe fn from_history_type(type_: HistoryType) -> QBox<QHistoryState>[src]

Constructs a new history state of the given type, with the given parent state.

Calls C++ function: [constructor] void QHistoryState::QHistoryState(QHistoryState::HistoryType type).

C++ documentation:

Constructs a new history state of the given type, with 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 QHistoryState::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* QHistoryState::qt_metacast(const char* arg1).

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

Sets this history state's default state to be the given state. state must be a sibling of this history state.

Calls C++ function: void QHistoryState::setDefaultState(QAbstractState* state).

C++ documentation:

Sets this history state's default state to be the given state. state must be a sibling of this history state.

Note that this function does not set state as the initial state of its parent.

Note: Setter function for property defaultState.

See also defaultState().

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

Sets this history state's default transition to be the given transition. This will set the source state of the transition to the history state.

Calls C++ function: void QHistoryState::setDefaultTransition(QAbstractTransition* transition).

C++ documentation:

Sets this history state's default transition to be the given transition. This will set the source state of the transition to the history state.

Note that the eventTest method of the transition will never be called.

This function was introduced in Qt 5.6.

Note: Setter function for property defaultTransition.

See also defaultTransition().

pub unsafe fn set_history_type(&self, type_: HistoryType)[src]

Sets the type of history that this history state records.

Calls C++ function: void QHistoryState::setHistoryType(QHistoryState::HistoryType type).

C++ documentation:

Sets the type of history that this history state records.

Note: Setter function for property historyType.

See also historyType().

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 QHistoryState::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 QHistoryState::trUtf8(const char* s, const char* c, int n).

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 QHistoryState[src]

unsafe fn delete(&self)[src]

Destroys this history state.

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

C++ documentation:

Destroys this history state.

impl Deref for QHistoryState[src]

type Target = QAbstractState

The resulting type after dereferencing.

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

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

impl DynamicCast<QHistoryState> for QAbstractState[src]

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

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

impl DynamicCast<QHistoryState> for QObject[src]

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

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

impl StaticDowncast<QHistoryState> for QAbstractState[src]

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

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

impl StaticDowncast<QHistoryState> for QObject[src]

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

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

impl StaticUpcast<QAbstractState> for QHistoryState[src]

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

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

impl StaticUpcast<QObject> for QHistoryState[src]

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

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