summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2020-07-29 13:01:49 +0200
committerMitch Curtis <mitch.curtis@qt.io>2020-07-31 16:54:10 +0200
commit46ec92dad0f71c8d5e3260a67321d82054ea607e (patch)
tree881cc30035900bf147b53881cd57ee8bbe2ca951 /src
parent0792188440e12b211102a1e624828aec46964c9f (diff)
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')
-rw-r--r--src/gui/kernel/qevent.h13
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;