aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/referenceexamples/properties
diff options
context:
space:
mode:
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