diff options
Diffstat (limited to 'examples/declarative/extending/attached/main.cpp')
-rw-r--r-- | examples/declarative/extending/attached/main.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/examples/declarative/extending/attached/main.cpp b/examples/declarative/extending/attached/main.cpp index 27a9287..684d8d3 100644 --- a/examples/declarative/extending/attached/main.cpp +++ b/examples/declarative/extending/attached/main.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ #include <QCoreApplication> -#include <QmlEngine> -#include <QmlComponent> +#include <QDeclarativeEngine> +#include <QDeclarativeComponent> #include <QDebug> #include "birthdayparty.h" #include "person.h" @@ -49,8 +49,15 @@ int main(int argc, char ** argv) { QCoreApplication app(argc, argv); - QmlEngine engine; - QmlComponent component(&engine, ":example.qml"); + QML_REGISTER_NOCREATE_TYPE(BirthdayPartyAttached); + QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty); + QML_REGISTER_NOCREATE_TYPE(ShoeDescription); + QML_REGISTER_NOCREATE_TYPE(Person); + QML_REGISTER_TYPE(People, 1,0, Boy, Boy); + QML_REGISTER_TYPE(People, 1,0, Girl, Girl); + + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, ":example.qml"); BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create()); if (party && party->celebrant()) { |