From 5e89c1406e12b59b5818bd497c9aba4673e05577 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 3 May 2021 22:07:24 +0200 Subject: Delete less-than operator for QKeyCombination QMetaType relies on QTypeTraits to identify whether a type provides operator<. Due to the the deprecated implicit conversion to int, this results in several screens of deprecation warnings when using QKeyCombination in a signal parameter or as a property type. QKeyCombination has no ordering semantics (is Alt+F5 larger than Control+Up?), so delete the operator. [ChangeLog][QtCore][QKeyCombination] Potentially source-incompatible change: the less-than operator for QKeyCombination has been deleted. Code relying on the deprecated implicit conversion to int will no longer compile. Use QKeyCombination::toCombined explicitly. Change-Id: Ic8522b88d68063f74b5a5582c51aee8e18982331 Reviewed-by: Fabian Kosmale --- src/corelib/global/qnamespace.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/corelib/global/qnamespace.h') diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 0f5003e593..f678c81c6b 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1919,6 +1919,8 @@ public: { return lhs.combination != rhs.combination; } + + bool operator<(QKeyCombination) const = delete; }; Q_DECLARE_TYPEINFO(QKeyCombination, Q_RELOCATABLE_TYPE); -- cgit v1.2.3