aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h')
-rw-r--r--tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h
index 6267868375..40569879ec 100644
--- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h
+++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h
@@ -37,10 +37,12 @@
class Interface {};
class Interface2 {};
+class Interface3 {};
QT_BEGIN_NAMESPACE
Q_DECLARE_INTERFACE(Interface, "io.qt.bugreports.Interface");
Q_DECLARE_INTERFACE(Interface2, "io.qt.bugreports.Interface2");
+Q_DECLARE_INTERFACE(Interface3, "io.qt.bugreports.Interface3");
QT_END_NAMESPACE
@@ -150,6 +152,49 @@ public:
DerivedFromForeign(QObject *parent) : QTimeLine(1000, parent) {}
};
+class ExtensionA : public QObject
+{
+ Q_OBJECT
+ QML_ANONYMOUS
+ Q_PROPERTY(int a READ a CONSTANT)
+public:
+ ExtensionA(QObject *parent = nullptr) : QObject(parent) {}
+ int a() const { return 'a'; }
+};
+
+class ExtensionB : public QObject
+{
+ Q_OBJECT
+ QML_ANONYMOUS
+ Q_PROPERTY(int b READ b CONSTANT)
+public:
+ ExtensionB(QObject *parent = nullptr) : QObject(parent) {}
+ int b() const { return 'b'; }
+};
+
+class MultiExtensionParent : public QObject, public Interface3
+{
+ Q_OBJECT
+ QML_ANONYMOUS
+ QML_EXTENDED(ExtensionA)
+ QML_IMPLEMENTS_INTERFACES(Interface3)
+ Q_PROPERTY(int p READ p CONSTANT)
+public:
+ MultiExtensionParent(QObject *parent = nullptr) : QObject(parent) {}
+ int p() const { return 'p'; }
+};
+
+class MultiExtension : public MultiExtensionParent
+{
+ Q_OBJECT
+ QML_ELEMENT
+ QML_EXTENDED(ExtensionB)
+ Q_PROPERTY(int e READ e CONSTANT)
+public:
+ MultiExtension(QObject *parent = nullptr) : MultiExtensionParent(parent) {}
+ int e() const { return 'e'; }
+};
+
class tst_qmltyperegistrar : public QObject
{
Q_OBJECT
@@ -170,6 +215,7 @@ private slots:
void namespacedElement();
void derivedFromForeign();
void metaTypesRegistered();
+ void multiExtensions();
private:
QByteArray qmltypesData;