Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QSignalTransition Class

TheQSignalTransition class provides a transition based on a Qt signal.More...

Header:#include <QSignalTransition>
Since: Qt 4.6
Inherits:QAbstractTransition

Properties

Public Functions

QSignalTransition(QState * sourceState = 0)
QSignalTransition(QObject * sender, const char * signal, QState * sourceState = 0)
~QSignalTransition()
QObject *senderObject() const
voidsetSenderObject(QObject * sender)
voidsetSignal(const QByteArray & signal)
QByteArraysignal() const

Reimplemented Protected Functions

virtual boolevent(QEvent * e)
virtual booleventTest(QEvent * event)
virtual voidonTransition(QEvent * event)

Additional Inherited Members

Detailed Description

TheQSignalTransition class provides a transition based on a Qt signal.

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

You can subclassQSignalTransition and reimplementeventTest() to make a signal transition conditional; the event object passed toeventTest() will be aQStateMachine::SignalEvent object. Example:

class CheckedTransition :publicQSignalTransition{public:    CheckedTransition(QCheckBox*check)        :QSignalTransition(check, SIGNAL(stateChanged(int))) {}protected:    bool eventTest(QEvent*e) {if (!QSignalTransition::eventTest(e))returnfalse;QStateMachine::SignalEvent*se=static_cast<QStateMachine::SignalEvent*>(e);return (se->arguments().at(0).toInt()==Qt::Checked);    }};...QCheckBox*check=newQCheckBox();check->setTristate(true);QState*s1=newQState();QState*s2=newQState();CheckedTransition*t1=new CheckedTransition(check);t1->setTargetState(s2);s1->addTransition(t1);

Property Documentation

senderObject :QObject *

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

Access functions:

QObject *senderObject() const
voidsetSenderObject(QObject * sender)

signal :QByteArray

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

Access functions:

QByteArraysignal() const
voidsetSignal(const QByteArray & signal)

Member Function Documentation

QSignalTransition::QSignalTransition(QState * sourceState = 0)

Constructs a new signal transition with the givensourceState.

QSignalTransition::QSignalTransition(QObject * sender, constchar * signal,QState * sourceState = 0)

Constructs a new signal transition associated with the givensignal of the givensender, and with the givensourceState.

QSignalTransition::~QSignalTransition()

Destroys this signal transition.

[virtual protected]bool QSignalTransition::event(QEvent * e)

Reimplemented fromQObject::event().

[virtual protected]bool QSignalTransition::eventTest(QEvent * event)

Reimplemented fromQAbstractTransition::eventTest().

The default implementation returns true if theevent is aQStateMachine::SignalEvent object and the event's sender and signal index match this transition, and returns false otherwise.

[virtual protected]void QSignalTransition::onTransition(QEvent * event)

Reimplemented fromQAbstractTransition::onTransition().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp