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 <fabian.kosmale@qt.io>
bb10
Volker Hilsheimer 2021-05-03 22:07:24 +02:00
parent 1e0be201c3
commit 5e89c1406e
1 changed files with 2 additions and 0 deletions

View File

@ -1919,6 +1919,8 @@ public:
{
return lhs.combination != rhs.combination;
}
bool operator<(QKeyCombination) const = delete;
};
Q_DECLARE_TYPEINFO(QKeyCombination, Q_RELOCATABLE_TYPE);