diff options
Diffstat (limited to 'examples/declarative/extending/adding/main.cpp')
-rw-r--r-- | examples/declarative/extending/adding/main.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/declarative/extending/adding/main.cpp b/examples/declarative/extending/adding/main.cpp index 74ea35c..76e0736 100644 --- a/examples/declarative/extending/adding/main.cpp +++ b/examples/declarative/extending/adding/main.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ #include <QCoreApplication> -#include <QmlEngine> -#include <QmlComponent> +#include <QDeclarativeEngine> +#include <QDeclarativeComponent> #include <QDebug> #include "person.h" @@ -48,8 +48,10 @@ int main(int argc, char ** argv) { QCoreApplication app(argc, argv); - QmlEngine engine; - QmlComponent component(&engine, ":example.qml"); + QML_REGISTER_TYPE(People, 1,0, Person, Person); + + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, ":example.qml"); Person *person = qobject_cast<Person *>(component.create()); if (person) { qWarning() << "The person's name is" << person->name(); |