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

QEventTransition Class

TheQEventTransition class provides aQObject-specific transition for Qt events.More...

Header:#include <QEventTransition>
Since: Qt 4.6
Inherits:QAbstractTransition
Inherited By:

QKeyEventTransition andQMouseEventTransition

Properties

Public Functions

QEventTransition(QState * sourceState = 0)
QEventTransition(QObject * object, QEvent::Type type, QState * sourceState = 0)
~QEventTransition()
QObject *eventSource() const
QEvent::TypeeventType() const
voidsetEventSource(QObject * object)
voidsetEventType(QEvent::Type type)

Reimplemented Protected Functions

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

Additional Inherited Members

Detailed Description

TheQEventTransition class provides aQObject-specific transition for Qt events.

AQEventTransition object binds an event to a particularQObject.QEventTransition is part ofThe State Machine Framework.

Example:

QPushButton*button=...;QState*s1=...;QState*s2=...;// If in s1 and the button receives an Enter event, transition to s2QEventTransition*enterTransition=newQEventTransition(button,QEvent::Enter);enterTransition->setTargetState(s2);s1->addTransition(enterTransition);// If in s2 and the button receives an Exit event, transition back to s1QEventTransition*leaveTransition=newQEventTransition(button,QEvent::Leave);leaveTransition->setTargetState(s1);s2->addTransition(leaveTransition);

Subclassing

When reimplementing theeventTest() function, you should first call the base implementation to verify that the event is aQStateMachine::WrappedEvent for the proper object and event type. You may then cast the event to aQStateMachine::WrappedEvent and get the original event by callingQStateMachine::WrappedEvent::event(), and perform additional checks on that object.

See alsoQState::addTransition().

Property Documentation

eventSource :QObject *

This property holds the event source that this event transition is associated with.

Access functions:

QObject *eventSource() const
voidsetEventSource(QObject * object)

eventType :QEvent::Type

This property holds the type of event that this event transition is associated with.

Access functions:

QEvent::TypeeventType() const
voidsetEventType(QEvent::Type type)

Member Function Documentation

QEventTransition::QEventTransition(QState * sourceState = 0)

Constructs a newQEventTransition object with the givensourceState.

QEventTransition::QEventTransition(QObject * object,QEvent::Type type,QState * sourceState = 0)

Constructs a newQEventTransition object associated with events of the giventype for the givenobject, and with the givensourceState.

QEventTransition::~QEventTransition()

Destroys thisQObject event transition.

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

Reimplemented fromQObject::event().

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

Reimplemented fromQAbstractTransition::eventTest().

[virtual protected]void QEventTransition::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