summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qevent.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-08-21 13:34:52 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-08-25 06:34:01 +0200
commitc7f727996909338c3689396160f3060480521846 (patch)
treec8ec4dada74a6e1c3f5552a9e32bacde59bdba0d /src/gui/kernel/qevent.cpp
parentfb9ec8ad44decba7b2878370f3711b61614f035a (diff)
Introduce QEvent::isPointerEvent()
This makes high-level event dispatching easier: for example in Qt Quick, all pointer events should eventually be delivered to items in a similar way. Implemented in a similar way as d1111632e29124531d5b4512e0492314caaae396. Change-Id: I2f0c4914bab228162f3b932dda8a88051ec2a4d7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/kernel/qevent.cpp')
-rw-r--r--src/gui/kernel/qevent.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 2414a0d951..ab60a74e1b 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -167,6 +167,13 @@ QInputEvent::QInputEvent(Type type, const QInputDevice *dev, Qt::KeyboardModifie
/*!
\internal
*/
+QInputEvent::QInputEvent(QEvent::Type type, QEvent::PointerEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers)
+ : QEvent(type, QEvent::PointerEventTag{}), m_dev(dev), m_modState(modifiers)
+{}
+
+/*!
+ \internal
+*/
QInputEvent::~QInputEvent()
{
}
@@ -345,7 +352,7 @@ QPointF QEventPoint::lastNormalizedPos() const
}
QPointerEvent::QPointerEvent(QEvent::Type type, const QPointingDevice *dev, Qt::KeyboardModifiers modifiers)
- : QInputEvent(type, dev, modifiers)
+ : QInputEvent(type, QEvent::PointerEventTag{}, dev, modifiers)
{
}