diff options
author | Richard Dale <richard.dale@codethink.co.uk> | 2013-07-04 09:56:52 +0100 |
---|---|---|
committer | Richard Dale <richard.dale@codethink.co.uk> | 2013-07-04 09:56:52 +0100 |
commit | acf9e50d52c4d09a1aed9490bb2f3c5de7dce9bb (patch) | |
tree | 5b05df5a9e67f397bc7629f0921bc30c64bcc03e /examples/quick/controls/text/src/main.cpp | |
parent | a7e874ddf3496766903fc88e52fb61573c3d3f74 (diff) | |
parent | aa4ddfd8443f07badc0899d835027e46c6e0dfd8 (diff) | |
download | qtquickcontrols-baserock/morph.tar.gz |
Merge v5.1.0 releasebaserock/morph
Diffstat (limited to 'examples/quick/controls/text/src/main.cpp')
-rw-r--r-- | examples/quick/controls/text/src/main.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/examples/quick/controls/text/src/main.cpp b/examples/quick/controls/text/src/main.cpp index 0fc064dc..8d2b8dd0 100644 --- a/examples/quick/controls/text/src/main.cpp +++ b/examples/quick/controls/text/src/main.cpp @@ -49,24 +49,14 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QQmlEngine engine; - qmlRegisterType<DocumentHandler>("org.qtproject.example", 1, 0, "DocumentHandler"); - - QQmlComponent component(&engine); - component.loadUrl(QUrl("qrc:/qml/main.qml")); - if ( !component.isReady() ) { - qWarning("%s", qPrintable(component.errorString())); - return -1; - } - QObject *topLevel = component.create(); + QQmlApplicationEngine engine(QUrl("qrc:/qml/main.qml")); + QObject *topLevel = engine.rootObjects().value(0); QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel); if ( !window ) { qWarning("Error: Your root item has to be a Window."); return -1; } - - QObject::connect(&engine, SIGNAL(quit()), &app, SLOT(quit())); window->show(); return app.exec(); } |