InputMethodQueryResult - use int as a key, not Qt::InputMethodQuery

In release mode different qHash overloads picked up for enumerators
in 2 different translation units (and this can be even affected by the
order of includes), thus resulting in one hash with which we insert
a value, and a different hash, when we are trying to extract the value,
which _is_ in QHash; getting us a default value (invalid QVariant in our case).

Pick-to: 6.2 6.4
Fixes: QTBUG-106219
Change-Id: I7cce35555d792f03e50639a8d3d25f6a74de05a6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Timur Pocheptsov 2022-09-23 08:59:45 +02:00
parent b439f06941
commit b22a726f25

View File

@ -313,7 +313,7 @@ QSendSuperHelper<Args...> qt_objcDynamicSuperHelper(id receiver, SEL selector, A
// -------------------------------------------------------------------------
struct InputMethodQueryResult : public QHash<Qt::InputMethodQuery, QVariant>
struct InputMethodQueryResult : public QHash<int, QVariant>
{
operator bool() { return !isEmpty(); }
};