QEventTransition¶
The
QEventTransition
class provides aQObject
-specific transition for Qt events. More…
Inherited by: QKeyEventTransition, QMouseEventTransition
New in version 4.6.
Synopsis¶
Functions¶
def
eventSource
()def
eventType
()def
setEventSource
(object)def
setEventType
(type)
Detailed Description¶
A
QEventTransition
object binds an event to a particularQObject
.QEventTransition
is part of The State Machine Framework .Example:
QPushButton *button = ...; QState *s1 = ...; QState *s2 = ...; // If in s1 and the button receives an Enter event, transition to s2 QEventTransition *enterTransition = new QEventTransition(button, QEvent::Enter); enterTransition->setTargetState(s2); s1->addTransition(enterTransition); // If in s2 and the button receives an Exit event, transition back to s1 QEventTransition *leaveTransition = new QEventTransition(button, QEvent::Leave); leaveTransition->setTargetState(s1); s2->addTransition(leaveTransition);
Subclassing¶
When reimplementing the
eventTest()
function, you should first call the base implementation to verify that the event is aWrappedEvent
for the proper object and event type. You may then cast the event to aWrappedEvent
and get the original event by callingevent()
, and perform additional checks on that object.See also
-
class
QEventTransition
(object, type[, sourceState=None])¶ Constructs a new
QEventTransition
object associated with events of the giventype
for the givenobject
, and with the givensourceState
.Constructs a new
QEventTransition
object with the givensourceState
.
-
PySide2.QtCore.QEventTransition.
eventSource
()¶ - Return type
Returns the event source associated with this event transition.
See also
-
PySide2.QtCore.QEventTransition.
eventType
()¶ - Return type
Type
Returns the event type that this event transition is associated with.
See also
-
PySide2.QtCore.QEventTransition.
setEventSource
(object)¶ - Parameters
object –
QObject
Sets the event source associated with this event transition to be the given
object
.See also
-
PySide2.QtCore.QEventTransition.
setEventType
(type)¶ - Parameters
type –
Type
Sets the event
type
that this event transition is associated with.See also
© 2018 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 the GNU 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.