diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-27 23:54:08 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-28 20:36:12 +0100 |
commit | a3d71792ca018b1cff06dbefde20f6f4e06ee704 (patch) | |
tree | 6376412068fe583d2f9090c5f8afe69960c2be52 /src/gui/kernel/qevent.h | |
parent | 9b35f22b58bfdf0e88dfc5baa4387968a81c169a (diff) |
Make comparison operators hidden friends
Reduce ADL noise from QKeyEvent, QKeySequence::StandardKey, and
QPointingDeviceUniqueId.
Task-number: QTBUG-87973
Change-Id: Ib4a3190d03046949acb25b3fe68c611689b82565
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index fe728bc40c..f4cbf6f7af 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -534,6 +534,13 @@ public: inline quint32 nativeVirtualKey() const { return m_virtualKey; } inline quint32 nativeModifiers() const { return m_modifiers; } +#if QT_CONFIG(shortcut) + friend inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key) + { return (e ? e->matches(key) : false); } + friend inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e) + { return (e ? e->matches(key) : false); } +#endif // QT_CONFIG(shortcut) + protected: QString m_text; int m_key; @@ -984,11 +991,6 @@ private: Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *); #endif -#if QT_CONFIG(shortcut) -inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key){return (e ? e->matches(key) : false);} -inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e){return (e ? e->matches(key) : false);} -#endif // QT_CONFIG(shortcut) - class Q_GUI_EXPORT QTouchEvent : public QPointerEvent { public: |