summaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp')
-rw-r--r--tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp b/tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp
new file mode 100644
index 0000000..90ff581
--- /dev/null
+++ b/tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp
@@ -0,0 +1,38 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include "../../shared/util.h"
+
+#include <qtest.h>
+#include <qqmlengine.h>
+#include <qqmlcomponent.h>
+
+#include <private/qqmlmetatype_p.h>
+#include <private/qqmlengine_p.h>
+
+class tst_qqmlstatemachinemetatype : public QQmlDataTest
+{
+ Q_OBJECT
+
+private slots:
+ void unregisterAttachedProperties()
+ {
+ qmlClearTypeRegistrations();
+
+ QQmlEngine e;
+ QQmlComponent c(&e, testFileUrl("unregisterAttachedProperties.qml"));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+
+ const QQmlType attachedType = QQmlMetaType::qmlType("QtQuick/KeyNavigation",
+ QTypeRevision::fromVersion(2, 2));
+ QCOMPARE(attachedType.attachedPropertiesType(QQmlEnginePrivate::get(&e)),
+ attachedType.metaObject());
+
+ QScopedPointer<QObject> obj(c.create());
+ QVERIFY(obj);
+ }
+};
+
+QTEST_MAIN(tst_qqmlstatemachinemetatype)
+
+#include "tst_qqmlstatemachinemetatype.moc"