From b3f15cae22355eb95660a44b2e7c6981fe78ac15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 24 Oct 2022 12:47:27 +0200 Subject: [PATCH] qtwindowsglobal: Fix mixed-enum operations warning With c++20 doing operations between different enums is warning(-as-error). Declare operator-overloads for a particular pair of enums to make this compile again. Requires giving one of them a name as it was previously unnamed. Change-Id: I23296117b6d9a84273da6639582e075d631e5602 Reviewed-by: Friedemann Kleint (cherry picked from commit ba4710a33f408508772464c1e98ecab4378e4ecc) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/windows/qtwindowsglobal.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h index 9a65603e247..75f984b4b0c 100644 --- a/src/plugins/platforms/windows/qtwindowsglobal.h +++ b/src/plugins/platforms/windows/qtwindowsglobal.h @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE namespace QtWindows { -enum +enum WindowsEventTypeFlags { WindowEventFlag = 0x10000, MouseEventFlag = 0x20000, @@ -146,6 +146,8 @@ enum WindowsEventType // Simplify event types GestureEvent = 124, UnknownEvent = 542 }; +Q_DECLARE_MIXED_ENUM_OPERATORS(bool, WindowsEventTypeFlags, WindowsEventType); +Q_DECLARE_MIXED_ENUM_OPERATORS(bool, WindowsEventType, WindowsEventTypeFlags); // Matches Process_DPI_Awareness (Windows 8.1 onwards), used for SetProcessDpiAwareness() enum ProcessDpiAwareness