diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-08-25 15:59:39 -0300 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-09-01 19:51:39 +0000 |
commit | 2932130a8ee0157d3158a380924b7e9df8b52a2d (patch) | |
tree | 56cd7690c8cb505fbb1120e5e2afa6c7d5fa0736 /tests/auto | |
parent | abaf1aa13444df9930173451585d6be6b8c0d8c4 (diff) |
QVariant: fix conversions of string keys to Q_ENUM that are QFlags<>
Since Qt 6.0, QMetaType stores the name obtained from the C++ compiler,
which means we know a type like Qt::Alignment by its proper, full name
of QFlags<Qt::AlignmentFlag>. However, the meta object records only the
bare name of the enumeration, not the full flags.
Fixes: QTBUG-105932
Fixes: QTBUG-96185
Change-Id: Ic6547f8247454b47baa8fffd170eab977e306377
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 98e21f0979143a1e278572390012f021dfed1b6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index f20fd0cd87..e7f2c2bd9a 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -4715,6 +4715,11 @@ void tst_QVariant::metaEnums() METAENUMS_TEST(MetaEnumTest_Enum5_value); METAENUMS_TEST(MetaEnumTest_Enum6_value); METAENUMS_TEST(MetaEnumTest_Enum8_value); + +#undef METAENUMS_TEST + + testVariantMeta(Qt::RichText, &ok, "RichText"); + testVariantMeta(Qt::Alignment(Qt::AlignBottom), &ok, "AlignBottom"); } void tst_QVariant::nullConvert() |