[][src]Struct qt_core::QSignalTransition

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

The QSignalTransition class provides a transition based on a Qt signal.

C++ class: QSignalTransition.

C++ documentation:

The QSignalTransition class provides a transition based on a Qt signal.

Typically you would use the overload of QState::addTransition() that takes a sender and signal as arguments, rather than creating QSignalTransition objects directly. QSignalTransition is part of The State Machine Framework.

You can subclass QSignalTransition and reimplement eventTest() to make a signal transition conditional; the event object passed to eventTest() will be a QStateMachine::SignalEvent object. Example:

class CheckedTransition : public QSignalTransition { public: CheckedTransition(QCheckBox check) : QSignalTransition(check, SIGNAL(stateChanged(int))) {} protected: bool eventTest(QEvent e) { if (!QSignalTransition::eventTest(e)) return false; QStateMachine::SignalEvent se = static_cast<QStateMachine::SignalEvent>(e); return (se->arguments().at(0).toInt() == Qt::Checked); } };

...

QCheckBox *check = new QCheckBox(); check->setTristate(true);

QState s1 = new QState(); QState s2 = new QState(); CheckedTransition *t1 = new CheckedTransition(check); t1->setTargetState(s2); s1->addTransition(t1);

Methods

impl QSignalTransition[src]

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

This signal is emitted when the senderObject property is changed.

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

C++ documentation:

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

See also QSignalTransition::senderObject.

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

This signal is emitted when the signal property is changed.

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

C++ documentation:

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

See also QSignalTransition::signal.

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

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

pub unsafe fn new_1a(
    source_state: impl CastInto<Ptr<QState>>
) -> QBox<QSignalTransition>
[src]

Constructs a new signal transition with the given sourceState.

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

C++ documentation:

Constructs a new signal transition with the given sourceState.

pub unsafe fn new_3a(
    sender: impl CastInto<Ptr<QObject>>,
    signal: *const c_char,
    source_state: impl CastInto<Ptr<QState>>
) -> QBox<QSignalTransition>
[src]

Constructs a new signal transition associated with the given signal of the given sender, and with the given sourceState.

Calls C++ function: [constructor] void QSignalTransition::QSignalTransition(const QObject* sender, const char* signal, QState* sourceState = …).

C++ documentation:

Constructs a new signal transition associated with the given signal of the given sender, and with the given sourceState.

pub unsafe fn new_0a() -> QBox<QSignalTransition>[src]

The QSignalTransition class provides a transition based on a Qt signal.

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

C++ documentation:

The QSignalTransition class provides a transition based on a Qt signal.

Typically you would use the overload of QState::addTransition() that takes a sender and signal as arguments, rather than creating QSignalTransition objects directly. QSignalTransition is part of The State Machine Framework.

You can subclass QSignalTransition and reimplement eventTest() to make a signal transition conditional; the event object passed to eventTest() will be a QStateMachine::SignalEvent object. Example:

class CheckedTransition : public QSignalTransition { public: CheckedTransition(QCheckBox check) : QSignalTransition(check, SIGNAL(stateChanged(int))) {} protected: bool eventTest(QEvent e) { if (!QSignalTransition::eventTest(e)) return false; QStateMachine::SignalEvent se = static_cast<QStateMachine::SignalEvent>(e); return (se->arguments().at(0).toInt() == Qt::Checked); } };

...

QCheckBox *check = new QCheckBox(); check->setTristate(true);

QState s1 = new QState(); QState s2 = new QState(); CheckedTransition *t1 = new CheckedTransition(check); t1->setTargetState(s2); s1->addTransition(t1);

pub unsafe fn new_2a(
    sender: impl CastInto<Ptr<QObject>>,
    signal: *const c_char
) -> QBox<QSignalTransition>
[src]

Constructs a new signal transition associated with the given signal of the given sender, and with the given sourceState.

Calls C++ function: [constructor] void QSignalTransition::QSignalTransition(const QObject* sender, const char* signal).

C++ documentation:

Constructs a new signal transition associated with the given signal of the given sender, and with the given sourceState.

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

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

pub unsafe fn sender_object(&self) -> QPtr<QObject>[src]

This property holds the sender object that this signal transition is associated with

Calls C++ function: QObject* QSignalTransition::senderObject() const.

C++ documentation:

This property holds the sender object that this signal transition is associated with

Access functions:

QObject *senderObject() const
void setSenderObject(const QObject *sender)

Notifier signal:

void senderObjectChanged()[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 set_sender_object(&self, sender: impl CastInto<Ptr<QObject>>)[src]

Sets the sender object associated with this signal transition.

Calls C++ function: void QSignalTransition::setSenderObject(const QObject* sender).

C++ documentation:

Sets the sender object associated with this signal transition.

Note: Setter function for property senderObject.

See also senderObject().

pub unsafe fn set_signal(&self, signal: impl CastInto<Ref<QByteArray>>)[src]

Sets the signal associated with this signal transition.

Calls C++ function: void QSignalTransition::setSignal(const QByteArray& signal).

C++ documentation:

Sets the signal associated with this signal transition.

Note: Setter function for property signal.

See also signal().

pub unsafe fn signal(&self) -> CppBox<QByteArray>[src]

This property holds the signal that this signal transition is associated with

Calls C++ function: QByteArray QSignalTransition::signal() const.

C++ documentation:

This property holds the signal that this signal transition is associated with

Access functions:

QByteArray signal() const
void setSignal(const QByteArray &signal)

Notifier signal:

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

Methods from Deref<Target = QAbstractTransition>

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

This signal is emitted when the transition has been triggered (after onTransition() has been called).

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

C++ documentation:

This signal is emitted when the transition has been triggered (after onTransition() 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 target_state_changed(&self) -> Signal<()>[src]

This signal is emitted when the targetState property is changed.

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

C++ documentation:

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

See also QAbstractTransition::targetState.

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

This signal is emitted when the targetStates property is changed.

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

C++ documentation:

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

See also QAbstractTransition::targetStates.

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

Adds the given animation to this transition. The transition does not take ownership of the animation.

Calls C++ function: void QAbstractTransition::addAnimation(QAbstractAnimation* animation).

C++ documentation:

Adds the given animation to this transition. The transition does not take ownership of the animation.

See also removeAnimation() and animations().

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

Returns the list of animations associated with this transition, or an empty list if it has no animations.

Calls C++ function: QList<QAbstractAnimation*> QAbstractTransition::animations() const.

C++ documentation:

Returns the list of animations associated with this transition, or an empty list if it has no animations.

See also addAnimation().

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

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

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

C++ documentation:

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

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

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

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

Removes the given animation from this transition.

Calls C++ function: void QAbstractTransition::removeAnimation(QAbstractAnimation* animation).

C++ documentation:

Removes the given animation from this transition.

See also addAnimation().

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

Sets the target state of this transition.

Calls C++ function: void QAbstractTransition::setTargetState(QAbstractState* target).

C++ documentation:

Sets the target state of this transition.

Note: Setter function for property targetState.

See also targetState().

pub unsafe fn set_target_states(
    &self,
    targets: impl CastInto<Ref<QListOfQAbstractState>>
)
[src]

Sets the target states of this transition to be the given targets.

Calls C++ function: void QAbstractTransition::setTargetStates(const QList<QAbstractState*>& targets).

C++ documentation:

Sets the target states of this transition to be the given targets.

Note: Setter function for property targetStates.

See also targetStates().

pub unsafe fn set_transition_type(&self, type_: TransitionType)[src]

Sets the type of the transition to type.

Calls C++ function: void QAbstractTransition::setTransitionType(QAbstractTransition::TransitionType type).

C++ documentation:

Sets the type of the transition to type.

Note: Setter function for property transitionType.

See also transitionType().

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

This property holds the source state (parent) of this transition

Calls C++ function: QState* QAbstractTransition::sourceState() const.

C++ documentation:

This property holds the source state (parent) of this transition

Access functions:

QState *sourceState() const

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

This property holds the target state of this transition

Calls C++ function: QAbstractState* QAbstractTransition::targetState() const.

C++ documentation:

This property holds the target state of this transition

If a transition has no target state, the transition may still be triggered, but this will not cause the state machine's configuration to change (i.e. the current state will not be exited and re-entered).

Access functions:

QAbstractState *targetState() const
void setTargetState(QAbstractState *target)

Notifier signal:

void targetStateChanged()[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 target_states(&self) -> CppBox<QListOfQAbstractState>[src]

This property holds the target states of this transition

Calls C++ function: QList<QAbstractState*> QAbstractTransition::targetStates() const.

C++ documentation:

This property holds the target states of this transition

If multiple states are specified, all must be descendants of the same parallel group state.

Access functions:

QList<QAbstractState *> targetStates() const
void setTargetStates(const QList<QAbstractState *> &targets)

Notifier signal:

void targetStatesChanged()[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 transition_type(&self) -> TransitionType[src]

indicates whether this transition is an internal transition, or an external transition.

Calls C++ function: QAbstractTransition::TransitionType QAbstractTransition::transitionType() const.

C++ documentation:

indicates whether this transition is an internal transition, or an external transition.

Internal and external transitions behave the same, except for the case of a transition whose source state is a compound state and whose target(s) is a descendant of the source. In such a case, an internal transition will not exit and re-enter its source state, while an external one will.

By default, the type is an external transition.

Access functions:

TransitionType transitionType() const
void setTransitionType(TransitionType type)

Trait Implementations

impl CppDeletable for QSignalTransition[src]

unsafe fn delete(&self)[src]

Destroys this signal transition.

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

C++ documentation:

Destroys this signal transition.

impl Deref for QSignalTransition[src]

type Target = QAbstractTransition

The resulting type after dereferencing.

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

Calls C++ function: QAbstractTransition* static_cast<QAbstractTransition*>(QSignalTransition* ptr).

impl DynamicCast<QSignalTransition> for QAbstractTransition[src]

unsafe fn dynamic_cast(ptr: Ptr<QAbstractTransition>) -> Ptr<QSignalTransition>[src]

Calls C++ function: QSignalTransition* dynamic_cast<QSignalTransition*>(QAbstractTransition* ptr).

impl DynamicCast<QSignalTransition> for QObject[src]

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

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

impl StaticDowncast<QSignalTransition> for QAbstractTransition[src]

unsafe fn static_downcast(
    ptr: Ptr<QAbstractTransition>
) -> Ptr<QSignalTransition>
[src]

Calls C++ function: QSignalTransition* static_cast<QSignalTransition*>(QAbstractTransition* ptr).

impl StaticDowncast<QSignalTransition> for QObject[src]

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

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

impl StaticUpcast<QAbstractTransition> for QSignalTransition[src]

unsafe fn static_upcast(ptr: Ptr<QSignalTransition>) -> Ptr<QAbstractTransition>[src]

Calls C++ function: QAbstractTransition* static_cast<QAbstractTransition*>(QSignalTransition* ptr).

impl StaticUpcast<QObject> for QSignalTransition[src]

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

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