QMouseEventTransition Class

The QMouseEventTransition class provides a transition for mouse events. 更多...

头文件: #include <QMouseEventTransition>
qmake: QT += widgets
开始支持版本: Qt 4.6
基类: QEventTransition

属性

公有函数

QMouseEventTransition(QState *sourceState = Q_NULLPTR)
QMouseEventTransition(QObject *object, QEvent::Type type, Qt::MouseButton button, QState *sourceState = Q_NULLPTR)
~QMouseEventTransition()
Qt::MouseButton button() const
QPainterPath hitTestPath() const
Qt::KeyboardModifiers modifierMask() const
void setButton(Qt::MouseButton button)
void setHitTestPath(const QPainterPath &path)
void setModifierMask(Qt::KeyboardModifiers modifierMask)

重新实现的受保护函数

virtual bool eventTest(QEvent *event)
virtual void onTransition(QEvent *event)

其他继承的成员

详细描述

The QMouseEventTransition class provides a transition for mouse events.

QMouseEventTransition is part of The State Machine Framework.

参见 QState::addTransition().

属性

button : Qt::MouseButton

This property holds the button that this mouse event transition is associated with

访问函数:

Qt::MouseButton button() const
void setButton(Qt::MouseButton button)

modifierMask : Qt::KeyboardModifiers

This property holds the keyboard modifier mask that this mouse event transition checks for

访问函数:

Qt::KeyboardModifiers modifierMask() const
void setModifierMask(Qt::KeyboardModifiers modifierMask)

成员函数

QMouseEventTransition::QMouseEventTransition(QState *sourceState = Q_NULLPTR)

Constructs a new mouse event transition with the given sourceState.

QMouseEventTransition::QMouseEventTransition(QObject *object, QEvent::Type type, Qt::MouseButton button, QState *sourceState = Q_NULLPTR)

Constructs a new mouse event transition for events of the given type for the given object, with the given button and sourceState.

QMouseEventTransition::~QMouseEventTransition()

Destroys this mouse event transition.

Qt::MouseButton QMouseEventTransition::button() const

Returns the button that this mouse event transition checks for.

Note: Getter function for property button.

参见 setButton().

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

重新实现 QAbstractTransition::eventTest().

QPainterPath QMouseEventTransition::hitTestPath() const

Returns the hit test path for this mouse event transition.

参见 setHitTestPath().

Qt::KeyboardModifiers QMouseEventTransition::modifierMask() const

Returns the keyboard modifier mask that this mouse event transition checks for.

Note: Getter function for property modifierMask.

参见 setModifierMask().

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

重新实现 QAbstractTransition::onTransition().

void QMouseEventTransition::setButton(Qt::MouseButton button)

Sets the button that this mouse event transition will check for.

Note: Setter function for property button.

参见 button().

void QMouseEventTransition::setHitTestPath(const QPainterPath &path)

Sets the hit test path for this mouse event transition to path. If a valid path has been set, the transition will only trigger if the mouse event position (QMouseEvent::pos()) is inside the path.

参见 hitTestPath() and QPainterPath::contains().

void QMouseEventTransition::setModifierMask(Qt::KeyboardModifiers modifierMask)

Sets the keyboard modifier mask that this mouse event transition will check for to modifierMask.

Note: Setter function for property modifierMask.

参见 modifierMask().