aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/referenceexamples/properties
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-09-12 17:03:52 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-01-13 16:47:57 +0100
commit2c3419e127e55810da1741725b4ff39f118cd577 (patch)
tree670ec93d28dadad06bd840a5694935ef8a7b2ac0 /examples/qml/referenceexamples/properties
parent4eff7299501ff932071300b3fa34fbeccb03d0d8 (diff)
Generate registrations for all examples
Now that we can generate all QML type information at build time, we should also use it. Change-Id: I647c72bbe38fdb2deb565b75c86a696af3d15b61 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'examples/qml/referenceexamples/properties')
-rw-r--r--examples/qml/referenceexamples/properties/birthdayparty.h1
-rw-r--r--examples/qml/referenceexamples/properties/main.cpp4
-rw-r--r--examples/qml/referenceexamples/properties/properties.pro4
3 files changed, 5 insertions, 4 deletions
diff --git a/examples/qml/referenceexamples/properties/birthdayparty.h b/examples/qml/referenceexamples/properties/birthdayparty.h
index 8d62c8dcd5..fb8b63a79d 100644
--- a/examples/qml/referenceexamples/properties/birthdayparty.h
+++ b/examples/qml/referenceexamples/properties/birthdayparty.h
@@ -67,6 +67,7 @@ class BirthdayParty : public QObject
Q_PROPERTY(QQmlListProperty<Person> guests READ guests)
// ![2]
// ![3]
+ QML_ELEMENT
public:
BirthdayParty(QObject *parent = nullptr);
diff --git a/examples/qml/referenceexamples/properties/main.cpp b/examples/qml/referenceexamples/properties/main.cpp
index 216869bf6c..e30e1d9fb1 100644
--- a/examples/qml/referenceexamples/properties/main.cpp
+++ b/examples/qml/referenceexamples/properties/main.cpp
@@ -58,10 +58,6 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
-//![register list]
- qmlRegisterTypesAndRevisions<BirthdayParty, Person>("People", 1);
-//![register list]
-
QQmlEngine engine;
QQmlComponent component(&engine, QUrl("qrc:example.qml"));
auto *party = qobject_cast<BirthdayParty *>(component.create());
diff --git a/examples/qml/referenceexamples/properties/properties.pro b/examples/qml/referenceexamples/properties/properties.pro
index 101c878abd..6697afa2c5 100644
--- a/examples/qml/referenceexamples/properties/properties.pro
+++ b/examples/qml/referenceexamples/properties/properties.pro
@@ -1,5 +1,9 @@
QT = core qml
+CONFIG += qmltypes
+QML_IMPORT_NAME = People
+QML_IMPORT_MAJOR_VERSION = 1
+
SOURCES += main.cpp \
person.cpp \
birthdayparty.cpp