Fix deployment docs.
authorLars Knoll <lars.knoll@digia.com>
Mon, 26 Nov 2012 09:52:20 +0000 (10:52 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 26 Nov 2012 13:57:58 +0000 (14:57 +0100)
Qt Quick is not dependent on widgets.

Change-Id: Icd7ab72d9558905ac6d3790faa0248b0d197ea8c
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>

src/quick/doc/src/appdevguide/deployment.qdoc

index a137f4e..12296ec 100644 (file)
@@ -59,7 +59,7 @@ QQmlEngine by either:
 
 \section2 Deploying with QQuickView
 
-QQuickView is a QWidget-based class that is able to load QML files.
+QQuickView is a QWindow-based class that is able to load QML files.
 For example, if there is a QML file, \c application.qml, like this:
 
 \qml
@@ -71,12 +71,12 @@ For example, if there is a QML file, \c application.qml, like this:
 It can be loaded in a Qt application's \c main.cpp file like this:
 
 \code
-    #include <QApplication>
+    #include <QGuiApplication>
     #include <QQuickView>
 
     int main(int argc, char *argv[])
     {
-        QApplication app(argc, argv);
+        QGuiApplication app(argc, argv);
 
         QQuickView view;
         view.setSource(QUrl::fromLocalFile("application.qml"));
@@ -86,7 +86,7 @@ It can be loaded in a Qt application's \c main.cpp file like this:
     }
 \endcode
 
-This creates a QWidget-based view that displays the contents of
+This creates a QWindow-based view that displays the contents of
 \c application.qml.
 
 The application's \c .pro \l{qmake Project Files}{project file} must specify
@@ -94,7 +94,7 @@ the \c declarative module for the \c QT variable. For example:
 
 \code
     TEMPLATE += app
-    QT += gui declarative
+    QT += quick
     SOURCES += main.cpp
 \endcode
 
@@ -107,14 +107,14 @@ can be constructed directly instead. In this case, \c application.qml is
 loaded as a QQmlComponent instance rather than placed into a view:
 
 \code
-    #include <QApplication>
+    #include <QGuiApplication>
     #include <QQmlEngine>
     #include <QQmlContext>
     #include <QQmlComponent>
 
     int main(int argc, char *argv[])
     {
-        QApplication app(argc, argv);
+        QGuiApplication app(argc, argv);
 
         QQmlEngine engine;
         QQmlContext *objectContext = new QQmlContext(engine.rootContext());
@@ -128,8 +128,12 @@ loaded as a QQmlComponent instance rather than placed into a view:
     }
 \endcode
 
-See \l{qtqml-cppintegration-data.html}{qtqml-cppintegration-exposecppattributes.html}{Exposing Attributes of C++ Types to QML} for more information about using
-QQmlEngine, QQmlContext and QQmlComponent, as well
+QGuiApplication can be replaced by a QCoreApplication in the code above in case you are not
+using any graphical items from Qt Quick. This allows using QML as a language without any
+dependencies to the Qt Gui module.
+
+See \l{qtqml-cppintegration-data.html}{qtqml-cppintegration-exposecppattributes.html}{Exposing Attributes of C++ Types to QML}
+for more information about using QQmlEngine, QQmlContext and QQmlComponent, as well
 as details on including QML files through \l{The Qt Resource System}{Qt's Resource system}.