aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/qml/qmlruntime.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/qml/qmlruntime.qdoc')
-rw-r--r--doc/src/qml/qmlruntime.qdoc38
1 files changed, 19 insertions, 19 deletions
diff --git a/doc/src/qml/qmlruntime.qdoc b/doc/src/qml/qmlruntime.qdoc
index 5853c14844..a803fabd7a 100644
--- a/doc/src/qml/qmlruntime.qdoc
+++ b/doc/src/qml/qmlruntime.qdoc
@@ -35,8 +35,8 @@ Declarative UI engine along with the built-in QML elements and plugin modules,
and it also provides access to third-party QML elements and modules.
Applications that use QML need to invoke the QML runtime in order to
-execute QML documents. This can be done by creating a QDeclarativeView
-or a QDeclarativeEngine, as described below. In addition, the Declarative UI
+execute QML documents. This can be done by creating a QQuickView
+or a QQmlEngine, as described below. In addition, the Declarative UI
package includes the \QQV tool, which loads \c .qml files. This tool is
useful for developing and testing QML code without the need to write
a C++ application to load the QML runtime.
@@ -47,17 +47,17 @@ a C++ application to load the QML runtime.
To deploy an application that uses QML, the QML runtime must be invoked by
the application. This is done by writing a Qt C++ application that loads the
-QDeclarativeEngine by either:
+QQmlEngine by either:
\list
-\o Loading the QML file through a QDeclarativeView instance, or
-\o Creating a QDeclarativeEngine instance and loading QML files with QDeclarativeComponent
+\o Loading the QML file through a QQuickView instance, or
+\o Creating a QQmlEngine instance and loading QML files with QQmlComponent
\endlist
-\section2 Deploying with QDeclarativeView
+\section2 Deploying with QQuickView
-QDeclarativeView is a QWidget-based class that is able to load QML files.
+QQuickView is a QWidget-based class that is able to load QML files.
For example, if there is a QML file, \c application.qml, like this:
\qml
@@ -70,13 +70,13 @@ It can be loaded in a Qt application's \c main.cpp file like this:
\code
#include <QApplication>
- #include <QDeclarativeView>
+ #include <QQuickView>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- QDeclarativeView view;
+ QQuickView view;
view.setSource(QUrl::fromLocalFile("application.qml"));
view.show();
@@ -97,27 +97,27 @@ the \c declarative module for the \c QT variable. For example:
\endcode
-\section2 Creating a QDeclarativeEngine directly
+\section2 Creating a QQmlEngine directly
If \c application.qml does not have any graphical components, or if it is
-preferred to avoid QDeclarativeView for other reasons, the QDeclarativeEngine
+preferred to avoid QQuickView for other reasons, the QQmlEngine
can be constructed directly instead. In this case, \c application.qml is
-loaded as a QDeclarativeComponent instance rather than placed into a view:
+loaded as a QQmlComponent instance rather than placed into a view:
\code
#include <QApplication>
- #include <QDeclarativeEngine>
- #include <QDeclarativeContext>
- #include <QDeclarativeComponent>
+ #include <QQmlEngine>
+ #include <QQmlContext>
+ #include <QQmlComponent>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- QDeclarativeEngine engine;
- QDeclarativeContext *objectContext = new QDeclarativeContext(engine.rootContext());
+ QQmlEngine engine;
+ QQmlContext *objectContext = new QQmlContext(engine.rootContext());
- QDeclarativeComponent component(&engine, "application.qml");
+ QQmlComponent component(&engine, "application.qml");
QObject *object = component.create(objectContext);
// ... delete object and objectContext when necessary
@@ -127,7 +127,7 @@ loaded as a QDeclarativeComponent instance rather than placed into a view:
\endcode
See \l {Using QML Bindings in C++ Applications} for more information about using
-QDeclarativeEngine, QDeclarativeContext and QDeclarativeComponent, as well
+QQmlEngine, QQmlContext and QQmlComponent, as well
as details on including QML files through \l{The Qt Resource System}{Qt's Resource system}.