From 46ec92dad0f71c8d5e3260a67321d82054ea607e Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 29 Jul 2020 13:01:49 +0200 Subject: [PATCH] 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' (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 Reviewed-by: Volker Hilsheimer Reviewed-by: Thiago Macieira --- src/gui/kernel/qevent.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 m_attributes;