summaryrefslogtreecommitdiffstats
path: root/src/gui/statemachine/qbasicmouseeventtransition.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/statemachine/qbasicmouseeventtransition.cpp')
-rw-r--r--src/gui/statemachine/qbasicmouseeventtransition.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/gui/statemachine/qbasicmouseeventtransition.cpp b/src/gui/statemachine/qbasicmouseeventtransition.cpp
index b7583f8..0cb727e 100644
--- a/src/gui/statemachine/qbasicmouseeventtransition.cpp
+++ b/src/gui/statemachine/qbasicmouseeventtransition.cpp
@@ -39,6 +39,7 @@ public:
QEvent::Type eventType;
Qt::MouseButton button;
+ Qt::KeyboardModifiers modifiersMask;
QPainterPath path;
};
@@ -118,6 +119,26 @@ void QBasicMouseEventTransition::setButton(Qt::MouseButton button)
}
/*!
+ Returns the keyboard modifiers mask that this mouse event transition checks
+ for.
+*/
+Qt::KeyboardModifiers QBasicMouseEventTransition::modifiersMask() const
+{
+ Q_D(const QBasicMouseEventTransition);
+ return d->modifiersMask;
+}
+
+/*!
+ Sets the keyboard modifiers mask that this mouse event transition will check
+ for.
+*/
+void QBasicMouseEventTransition::setModifiersMask(Qt::KeyboardModifiers modifiersMask)
+{
+ Q_D(QBasicMouseEventTransition);
+ d->modifiersMask = modifiersMask;
+}
+
+/*!
Returns the path for this mouse event transition.
*/
QPainterPath QBasicMouseEventTransition::path() const
@@ -144,6 +165,7 @@ bool QBasicMouseEventTransition::eventTest(QEvent *event) const
if (event->type() == d->eventType) {
QMouseEvent *me = static_cast<QMouseEvent*>(event);
return (me->button() == d->button)
+ && ((me->modifiers() & d->modifiersMask) == d->modifiersMask)
&& (d->path.isEmpty() || d->path.contains(me->pos()));
}
return false;
@@ -152,7 +174,7 @@ bool QBasicMouseEventTransition::eventTest(QEvent *event) const
/*!
\reimp
*/
-void QBasicMouseEventTransition::onTransition()
+void QBasicMouseEventTransition::onTransition(QEvent *)
{
}