diff options
Diffstat (limited to 'examples/qml/referenceexamples/valuesource')
3 files changed, 5 insertions, 3 deletions
diff --git a/examples/qml/referenceexamples/valuesource/happybirthdaysong.h b/examples/qml/referenceexamples/valuesource/happybirthdaysong.h index e2205a4ebb..2600208968 100644 --- a/examples/qml/referenceexamples/valuesource/happybirthdaysong.h +++ b/examples/qml/referenceexamples/valuesource/happybirthdaysong.h @@ -64,6 +64,7 @@ class HappyBirthdaySong : public QObject, public QQmlPropertyValueSource // ![0] Q_PROPERTY(QString name READ name WRITE setName) // ![1] + QML_ELEMENT public: HappyBirthdaySong(QObject *parent = nullptr); diff --git a/examples/qml/referenceexamples/valuesource/main.cpp b/examples/qml/referenceexamples/valuesource/main.cpp index 72e75fdea1..2e9995fcd8 100644 --- a/examples/qml/referenceexamples/valuesource/main.cpp +++ b/examples/qml/referenceexamples/valuesource/main.cpp @@ -59,9 +59,6 @@ int main(int argc, char ** argv) { QCoreApplication app(argc, argv); - qmlRegisterTypesAndRevisions<BirthdayPartyAttached, BirthdayParty, HappyBirthdaySong, - ShoeDescription, Person, Boy, Girl>("People", 1); - QQmlEngine engine; QQmlComponent component(&engine, QUrl("qrc:example.qml")); auto *party = qobject_cast<BirthdayParty *>(component.create()); diff --git a/examples/qml/referenceexamples/valuesource/valuesource.pro b/examples/qml/referenceexamples/valuesource/valuesource.pro index 01cfeeb6d8..6d29cf1b70 100644 --- a/examples/qml/referenceexamples/valuesource/valuesource.pro +++ b/examples/qml/referenceexamples/valuesource/valuesource.pro @@ -1,5 +1,9 @@ QT += qml +CONFIG += qmltypes +QML_IMPORT_NAME = People +QML_IMPORT_MAJOR_VERSION = 1 + SOURCES += main.cpp \ person.cpp \ birthdayparty.cpp \ |