diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-07-29 13:01:49 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2020-07-31 16:54:10 +0200 |
commit | 46ec92dad0f71c8d5e3260a67321d82054ea607e (patch) | |
tree | 881cc30035900bf147b53881cd57ee8bbe2ca951 /src/gui/kernel/qevent.h | |
parent | 0792188440e12b211102a1e624828aec46964c9f (diff) | |
download | qtbase-46ec92dad0f71c8d5e3260a67321d82054ea607e.tar.gz |
Fix build with MSVC2019
The error was:
src\virtualkeyboard\qvirtualkeyboardinputcontext_p.cpp(305): error C2678:
binary '!=': no operator found which takes a left-hand operand of type
'QList<QInputMethodEvent::Attribute>' (or there is no acceptable conversion)
This patch fixes the issue by manually defining an operator== for
QInputMethodEvent::Attribute.
Change-Id: Idb283cf7b6ff4388a38ea7780c3d5c1c5f77038d
Fixes: QTBUG-85789
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 0d7613e8ff..79a3ea3378 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -671,6 +671,19 @@ public: QInputMethodEvent(const QInputMethodEvent &other); + inline friend bool operator==(const QInputMethodEvent::Attribute &lhs, + const QInputMethodEvent::Attribute &rhs) + { + return lhs.type == rhs.type && lhs.start == rhs.start + && lhs.length == rhs.length && lhs.value == rhs.value; + } + + inline friend bool operator!=(const QInputMethodEvent::Attribute &lhs, + const QInputMethodEvent::Attribute &rhs) + { + return !(lhs == rhs); + } + private: QString m_preedit; QList<Attribute> m_attributes; |