aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/qml/qqmllanguage/testtypes.h14
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp8
2 files changed, 13 insertions, 9 deletions
diff --git a/tests/auto/qml/qqmllanguage/testtypes.h b/tests/auto/qml/qqmllanguage/testtypes.h
index 9a9a38a12a..1156d265ed 100644
--- a/tests/auto/qml/qqmllanguage/testtypes.h
+++ b/tests/auto/qml/qqmllanguage/testtypes.h
@@ -1438,15 +1438,15 @@ private:
QObjectList m_list;
};
-class ScopedEnumsWithNameClash
+namespace ScopedEnumsWithNameClash
{
- Q_GADGET
- Q_ENUMS(ScopedEnum)
- Q_ENUMS(OtherScopedEnum)
+Q_NAMESPACE
-public:
- enum class ScopedEnum : int { ScopedVal1, ScopedVal2, ScopedVal3, OtherScopedEnum };
- enum class OtherScopedEnum : int { ScopedVal1 = 10, ScopedVal2 = 11, ScopedVal3 = 12 };
+enum class ScopedEnum : int { ScopedVal1, ScopedVal2, ScopedVal3, OtherScopedEnum };
+Q_ENUM_NS(ScopedEnum)
+
+enum class OtherScopedEnum : int { ScopedVal1 = 10, ScopedVal2 = 11, ScopedVal3 = 12 };
+Q_ENUM_NS(OtherScopedEnum)
};
class ScopedEnumsWithResolvedNameClash
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 942284388a..1311319266 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -4103,7 +4103,9 @@ void tst_qqmllanguage::scopedEnum()
void tst_qqmllanguage::scopedEnumsWithNameClash()
{
- auto typeId = qmlRegisterUncreatableType<ScopedEnumsWithNameClash>("ScopedEnumsWithNameClashTest", 1, 0, "ScopedEnum", "Dummy reason");
+ auto typeId = qmlRegisterUncreatableMetaObject(
+ ScopedEnumsWithNameClash::staticMetaObject,
+ "ScopedEnumsWithNameClashTest", 1, 0, "ScopedEnum", "Dummy reason");
auto registryGuard = qScopeGuard([typeId]() {
QQmlMetaType::unregisterType(typeId);
});
@@ -4122,7 +4124,9 @@ void tst_qqmllanguage::scopedEnumsWithNameClash()
void tst_qqmllanguage::scopedEnumsWithResolvedNameClash()
{
- auto typeId = qmlRegisterUncreatableType<ScopedEnumsWithResolvedNameClash>("ScopedEnumsWithResolvedNameClashTest", 1, 0, "ScopedEnum", "Dummy reason");
+ auto typeId = qmlRegisterUncreatableMetaObject(
+ ScopedEnumsWithResolvedNameClash::staticMetaObject,
+ "ScopedEnumsWithResolvedNameClashTest", 1, 0, "ScopedEnum", "Dummy reason");
auto registryGuard = qScopeGuard([typeId]() {
QQmlMetaType::unregisterType(typeId);
});