diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 3dc0805dd1..b14c9ed167 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -460,7 +460,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) { QMetaEnum en = metaEnumFromType(d->type); if (en.isValid()) { - *str = QString::fromUtf8(en.valueToKeys(qConvertToNumber(d, ok))); + *str = QString::fromUtf8(en.valueToKey(qConvertToNumber(d, ok))); return *ok; } } @@ -637,7 +637,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) { QMetaEnum en = metaEnumFromType(d->type); if (en.isValid()) { - *ba = en.valueToKeys(qConvertToNumber(d, ok)); + *ba = en.valueToKey(qConvertToNumber(d, ok)); return *ok; } } diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index 52fc4e1806..32674c587c 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -77,7 +77,7 @@ public: } - enum MetaEnumTest_Enum0 { MetaEnumTest_Enum0_value = 42, MetaEnsureSignedEnum0 = -1 }; + enum MetaEnumTest_Enum0 { MetaEnumTest_Enum0_dummy = 2, MetaEnumTest_Enum0_value = 42, MetaEnsureSignedEnum0 = -1 }; Q_ENUM(MetaEnumTest_Enum0) enum MetaEnumTest_Enum1 { MetaEnumTest_Enum1_value = 42, MetaEnumTest_Enum1_bigValue = (Q_INT64_C(1) << 33) + 50 }; Q_ENUM(MetaEnumTest_Enum1)