diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-07-03 11:06:37 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-08-17 21:54:34 +0200 |
commit | d1111632e29124531d5b4512e0492314caaae396 (patch) | |
tree | 15bdf8c7f348b236a90f5ef59ceec4ce91ee4af1 /src/gui/kernel/qevent.cpp | |
parent | 81159cf3f7c47dbab4c781f3b4ffa9e0a202b1dc (diff) |
Introduce QEvent::isInputEvent
This makes it easier to reliably maintain input-event related states
in widgets, in particluar the state of keyboard modifiers. Instead of
testing for all possible event types, code can just test the flag before
safely static_cast'ing to QInputEvent to access the modifiers.
Simplify the code in QAbstractItemView accordingly.
Task-number: QTBUG-73829
Change-Id: Idc7c08e2f3f1e8844f5c6693c195153038ee6490
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/gui/kernel/qevent.cpp')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index aaf6da85cd..c8f2854514 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -163,7 +163,7 @@ QEnterEvent::~QEnterEvent() \internal */ QInputEvent::QInputEvent(Type type, const QInputDevice *dev, Qt::KeyboardModifiers modifiers) - : QEvent(type), m_dev(dev), m_modState(modifiers) + : QEvent(type, QEvent::InputEventTag{}), m_dev(dev), m_modState(modifiers) {} /*! |