aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2021-03-02 09:51:21 +0100
committerMaximilian Goldstein <max.goldstein@qt.io>2021-03-03 16:40:05 +0100
commit7f3692f5ce08a772c2e31c65325a430169711d61 (patch)
treeee8bbf1db82998619a254a51f50e581fa0ff61a0 /tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h
parent25ae86d1d98dbf3900eefea152b072939be8ea71 (diff)
qmlcompiler: Add support for required properties
Change-Id: I2687de04120ab224c5ccc409930526c29d8915bb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h')
-rw-r--r--tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h
index eb3b680e82..8d934d4996 100644
--- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h
+++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h
@@ -234,6 +234,19 @@ public:
int p() const { return 'p'; }
};
+class RequiredProperty : public QObject
+{
+ Q_OBJECT
+ QML_ELEMENT
+ Q_PROPERTY(int foo READ foo WRITE setFoo REQUIRED)
+public:
+ RequiredProperty(QObject *parent = nullptr) : QObject(parent) {}
+ int foo() { return m_foo; }
+ void setFoo(int foo) { m_foo = foo; }
+private:
+ int m_foo;
+};
+
class MultiExtension : public MultiExtensionParent
{
Q_OBJECT
@@ -267,6 +280,7 @@ private slots:
void metaTypesRegistered();
void multiExtensions();
void localDefault();
+ void requiredProperty();
private:
QByteArray qmltypesData;