aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/qml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/qml')
-rw-r--r--doc/src/qml/basictypes.qdoc2
-rw-r--r--doc/src/qml/c++models.qdoc10
-rw-r--r--doc/src/qml/codingconventions.qdoc20
-rw-r--r--doc/src/qml/debugging.qdoc10
-rw-r--r--doc/src/qml/dynamicobjects.qdoc32
-rw-r--r--doc/src/qml/extending-tutorial.qdoc30
-rw-r--r--doc/src/qml/integrating.qdoc18
-rw-r--r--doc/src/qml/javascriptblocks.qdoc40
-rw-r--r--doc/src/qml/modules.qdoc44
-rw-r--r--doc/src/qml/network.qdoc10
-rw-r--r--doc/src/qml/propertybinding.qdoc54
-rw-r--r--doc/src/qml/qmlcomponents.qdoc40
-rw-r--r--doc/src/qml/qmldocument.qdoc10
-rw-r--r--doc/src/qml/qmlengine.qdoc136
-rw-r--r--doc/src/qml/qmlevents.qdoc16
-rw-r--r--doc/src/qml/qmlintro.qdoc2
-rw-r--r--doc/src/qml/qmlplugins.qdoc12
-rw-r--r--doc/src/qml/qmlruntime.qdoc38
-rw-r--r--doc/src/qml/qmlsyntax.qdoc2
-rw-r--r--doc/src/qml/qmltypes.qdoc10
-rw-r--r--doc/src/qml/qmlviewer.qdoc2
-rw-r--r--doc/src/qml/qtbinding.qdoc166
-rw-r--r--doc/src/qml/qtdeclarative.qdoc48
-rw-r--r--doc/src/qml/qtprogrammers.qdoc14
24 files changed, 383 insertions, 383 deletions
diff --git a/doc/src/qml/basictypes.qdoc b/doc/src/qml/basictypes.qdoc
index 150383fdc2..0f66a96731 100644
--- a/doc/src/qml/basictypes.qdoc
+++ b/doc/src/qml/basictypes.qdoc
@@ -180,7 +180,7 @@
\div{float-right}
\inlineimage declarative-colors.png
\enddiv
- \snippet doc/src/snippets/declarative/colors.qml colors
+ \snippet doc/src/snippets/qml/colors.qml colors
Or with the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()},
\l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()} functions:
diff --git a/doc/src/qml/c++models.qdoc b/doc/src/qml/c++models.qdoc
index e2498134fe..943c79c184 100644
--- a/doc/src/qml/c++models.qdoc
+++ b/doc/src/qml/c++models.qdoc
@@ -57,7 +57,7 @@ models.
\bold{Note:} There is no way for the view to know that the contents of a QStringList
have changed. If the QStringList changes, it will be necessary to reset
- the model by calling QDeclarativeContext::setContextProperty() again.
+ the model by calling QQmlContext::setContextProperty() again.
\section1 QObjectList-based model
@@ -92,7 +92,7 @@ models.
Note: There is no way for the view to know that the contents of a QList
have changed. If the QList changes, it will be necessary to reset
- the model by calling QDeclarativeContext::setContextProperty() again.
+ the model by calling QQmlContext::setContextProperty() again.
\section1 QAbstractItemModel
@@ -160,10 +160,10 @@ models.
\section1 Exposing C++ Data Models to QML
-The above examples use QDeclarativeContext::setContextProperty() to set
+The above examples use QQmlContext::setContextProperty() to set
model values directly in QML components. An alternative to this is to
register the C++ model class as a QML type from a QML C++ plugin using
-QDeclarativeExtensionPlugin. This would allow the model classes to be
+QQmlExtensionPlugin. This would allow the model classes to be
created directly as elements within QML:
\table
@@ -171,7 +171,7 @@ created directly as elements within QML:
\o
\code
-class MyModelPlugin : public QDeclarativeExtensionPlugin
+class MyModelPlugin : public QQmlExtensionPlugin
{
public:
void registerTypes(const char *uri)
diff --git a/doc/src/qml/codingconventions.qdoc b/doc/src/qml/codingconventions.qdoc
index 89fdfd59f9..9e1ce34c2c 100644
--- a/doc/src/qml/codingconventions.qdoc
+++ b/doc/src/qml/codingconventions.qdoc
@@ -52,7 +52,7 @@ For better readability, we separate these different parts with an empty line.
For example, a hypothetical \i photo QML object would look like this:
-\snippet doc/src/snippets/declarative/codingconventions/photo.qml 0
+\snippet doc/src/snippets/qml/codingconventions/photo.qml 0
\section1 Grouped Properties
@@ -62,11 +62,11 @@ we use the \i {group notation} rather than the \i {dot notation} to improve read
For example, this:
-\snippet doc/src/snippets/declarative/codingconventions/dotproperties.qml 0
+\snippet doc/src/snippets/qml/codingconventions/dotproperties.qml 0
can be written like this:
-\snippet doc/src/snippets/declarative/codingconventions/dotproperties.qml 1
+\snippet doc/src/snippets/qml/codingconventions/dotproperties.qml 1
\section1 Private Properties
@@ -78,7 +78,7 @@ the implementation. As a convention, private properties begin with two
accessible but is not meant for public use. Note that QML and JavaScript will
grant the user access to these properties.
-\snippet doc/src/snippets/declarative/codingconventions/private.qml 0
+\snippet doc/src/snippets/qml/codingconventions/private.qml 0
\section1 Lists
@@ -89,30 +89,30 @@ For example, it is very common for a component to only have one state.
In this case, instead of:
-\snippet doc/src/snippets/declarative/codingconventions/lists.qml 0
+\snippet doc/src/snippets/qml/codingconventions/lists.qml 0
we will write this:
-\snippet doc/src/snippets/declarative/codingconventions/lists.qml 1
+\snippet doc/src/snippets/qml/codingconventions/lists.qml 1
\section1 JavaScript Code
If the script is a single expression, we recommend writing it inline:
-\snippet doc/src/snippets/declarative/codingconventions/javascript.qml 0
+\snippet doc/src/snippets/qml/codingconventions/javascript.qml 0
If the script is only a couple of lines long, we generally use a block:
-\snippet doc/src/snippets/declarative/codingconventions/javascript.qml 1
+\snippet doc/src/snippets/qml/codingconventions/javascript.qml 1
If the script is more than a couple of lines long or can be used by different objects, we recommend creating a function and calling it like this:
-\snippet doc/src/snippets/declarative/codingconventions/javascript.qml 2
+\snippet doc/src/snippets/qml/codingconventions/javascript.qml 2
For long scripts, we will put the functions in their own JavaScript file and import it like this:
-\snippet doc/src/snippets/declarative/codingconventions/javascript-imports.qml 0
+\snippet doc/src/snippets/qml/codingconventions/javascript-imports.qml 0
*/
diff --git a/doc/src/qml/debugging.qdoc b/doc/src/qml/debugging.qdoc
index 520e23abb5..562464a419 100644
--- a/doc/src/qml/debugging.qdoc
+++ b/doc/src/qml/debugging.qdoc
@@ -148,11 +148,11 @@ If you set \c {QML_IMPORT_TRACE=1} before running the \l {QML Viewer}
(or your QML C++ application), you will see output similar to this:
\code
-QDeclarativeImportDatabase::addImportPath "/qt-sdk/imports"
-QDeclarativeImportDatabase::addImportPath "/qt-sdk/bin/QMLViewer.app/Contents/MacOS"
-QDeclarativeImportDatabase::addToImport 0x106237370 "." -1.-1 File as ""
-QDeclarativeImportDatabase::addToImport 0x106237370 "Qt" 4.7 Library as ""
-QDeclarativeImportDatabase::resolveType "Rectangle" = "QDeclarativeRectangle"
+QQmlImportDatabase::addImportPath "/qt-sdk/imports"
+QQmlImportDatabase::addImportPath "/qt-sdk/bin/QMLViewer.app/Contents/MacOS"
+QQmlImportDatabase::addToImport 0x106237370 "." -1.-1 File as ""
+QQmlImportDatabase::addToImport 0x106237370 "Qt" 4.7 Library as ""
+QQmlImportDatabase::resolveType "Rectangle" = "QDeclarativeRectangle"
\endcode
diff --git a/doc/src/qml/dynamicobjects.qdoc b/doc/src/qml/dynamicobjects.qdoc
index e3d9adb49a..c50f9dd337 100644
--- a/doc/src/qml/dynamicobjects.qdoc
+++ b/doc/src/qml/dynamicobjects.qdoc
@@ -80,31 +80,31 @@ the component. This function can take one or two arguments:
Here is an example. First there is \c Sprite.qml, which defines a simple QML component:
-\snippet doc/src/snippets/declarative/Sprite.qml 0
+\snippet doc/src/snippets/qml/Sprite.qml 0
Our main application file, \c main.qml, imports a \c componentCreation.js JavaScript file
that will create \c Sprite objects:
-\snippet doc/src/snippets/declarative/createComponent.qml 0
+\snippet doc/src/snippets/qml/createComponent.qml 0
Here is \c componentCreation.js. Notice it checks whether the component \l{Component::status}{status} is
\c Component.Ready before calling \l {Component::createObject()}{createObject()}
in case the QML file is loaded over a network and thus is not ready immediately.
-\snippet doc/src/snippets/declarative/componentCreation.js vars
+\snippet doc/src/snippets/qml/componentCreation.js vars
\codeline
-\snippet doc/src/snippets/declarative/componentCreation.js func
-\snippet doc/src/snippets/declarative/componentCreation.js remote
-\snippet doc/src/snippets/declarative/componentCreation.js func-end
+\snippet doc/src/snippets/qml/componentCreation.js func
+\snippet doc/src/snippets/qml/componentCreation.js remote
+\snippet doc/src/snippets/qml/componentCreation.js func-end
\codeline
-\snippet doc/src/snippets/declarative/componentCreation.js finishCreation
+\snippet doc/src/snippets/qml/componentCreation.js finishCreation
If you are certain the QML file to be loaded is a local file, you could omit the \c finishCreation()
function and call \l {Component::createObject()}{createObject()} immediately:
-\snippet doc/src/snippets/declarative/componentCreation.js func
-\snippet doc/src/snippets/declarative/componentCreation.js local
-\snippet doc/src/snippets/declarative/componentCreation.js func-end
+\snippet doc/src/snippets/qml/componentCreation.js func
+\snippet doc/src/snippets/qml/componentCreation.js local
+\snippet doc/src/snippets/qml/componentCreation.js func-end
Notice in both instances, \l {Component::createObject()}{createObject()} is called with
\c appWindow passed as an argument so that the created object will become a child of the
@@ -124,7 +124,7 @@ use the signal \c connect() method. See
If the QML is not defined until runtime, you can create a QML item from
a string of QML using the \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example:
-\snippet doc/src/snippets/declarative/createQmlObject.qml 0
+\snippet doc/src/snippets/qml/createQmlObject.qml 0
The first argument is the string of QML to create. Just like in a new file, you will need to
import any types you wish to use. The second argument is the parent item for the new item;
@@ -145,7 +145,7 @@ The actual creation context depends on how an item is created:
\list
\o If \l {QML:Qt::createComponent()}{Qt.createComponent()} is used, the creation context
- is the QDeclarativeContext in which this method is called
+ is the QQmlContext in which this method is called
\o If \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
if called, the creation context is the context of the parent item passed to this method
\o If a \c {Component{}} item is defined and \l {Component::createObject()}{createObject()}
@@ -181,8 +181,8 @@ component. Each instance runs a NumberAnimation, and when the animation has fini
\o \c SelfDestroyingRect.qml
\row
-\o \snippet doc/src/snippets/declarative/dynamicObjects-destroy.qml 0
-\o \snippet doc/src/snippets/declarative/SelfDestroyingRect.qml 0
+\o \snippet doc/src/snippets/qml/dynamicObjects-destroy.qml 0
+\o \snippet doc/src/snippets/qml/SelfDestroyingRect.qml 0
\endtable
@@ -209,6 +209,6 @@ destroyed if they were dynamically created.
Objects created with \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
can similarly be destroyed using \c destroy():
-\snippet doc/src/snippets/declarative/createQmlObject.qml 0
-\snippet doc/src/snippets/declarative/createQmlObject.qml destroy
+\snippet doc/src/snippets/qml/createQmlObject.qml 0
+\snippet doc/src/snippets/qml/createQmlObject.qml destroy
*/
diff --git a/doc/src/qml/extending-tutorial.qdoc b/doc/src/qml/extending-tutorial.qdoc
index 00f4bb5691..b995c32cca 100644
--- a/doc/src/qml/extending-tutorial.qdoc
+++ b/doc/src/qml/extending-tutorial.qdoc
@@ -100,14 +100,14 @@ Here is our \c PieChart class, defined in \c piechart.h:
\snippet declarative/tutorials/extending/chapter1-basics/piechart.h 0
-The class inherits from QDeclarativeItem because we want to override
-QDeclarativeItem::paint() in order to draw. If the class just represented some
+The class inherits from QQuickItem because we want to override
+QQuickItem::paint() in order to draw. If the class just represented some
data type and was not an item that actually needed to be displayed, it could simply inherit
from QObject. Or, if we want to extend the functionality of an existing QObject-based
class, it could inherit from that class instead.
The \c PieChart class defines the two properties, \c name and \c color, with the Q_PROPERTY macro,
-and overrides QDeclarativeItem::paint(). The class implementation in \c piechart.cpp
+and overrides QQuickItem::paint(). The class implementation in \c piechart.cpp
simply sets and returns the \c m_name and \c m_color values as appropriate, and
implements \c paint() to draw a simple pie chart. It also turns off the
QGraphicsItem::ItemHasNoContents flag to enable painting:
@@ -127,7 +127,7 @@ converted to a QColor object for the PieChart \c color property. Automatic conve
provided for various other \l {QML Basic Types}{basic types}; for example, a string
like "640x480" can be automatically converted to a QSize value.
-We'll also create a C++ application that uses a QDeclarativeView to run and
+We'll also create a C++ application that uses a QQuickView to run and
display \c app.qml. The application must register the \c PieChart type
using the qmlRegisterType() function, to allow it to be used from QML. If
you don't register the type, \c app.qml won't be able to create a \c PieChart.
@@ -265,7 +265,7 @@ int-type property to store an identifier for each chart:
\code
// C++
- class PieChart : public QDeclarativeItem
+ class PieChart : public QQuickItem
{
Q_PROPERTY(int chartId READ chartId WRITE setChartId NOTIFY chartIdChanged)
...
@@ -306,7 +306,7 @@ we assign an \c PieSlice value which itself contains a \c color:
\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml 0
-Like \c PieChart, this new \c PieSlice type inherits from QDeclarativeItem and declares
+Like \c PieChart, this new \c PieSlice type inherits from QQuickItem and declares
its properties with Q_PROPERTY():
\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h 0
@@ -324,7 +324,7 @@ and associated method signatures:
There is one thing to be aware of when implementing \c setPieSlice(). The \c PieSlice
is a visual item, so it must be set as a child of the \c PieChart using
-QDeclarativeItem::setParentItem() so that the \c PieChart knows to paint this child
+QQuickItem::setParentItem() so that the \c PieChart knows to paint this child
item when its contents are drawn:
\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp 0
@@ -359,7 +359,7 @@ have a \c slices property that accepts a list of \c PieSlice items:
\image extending-tutorial-chapter5.png
To do this, we replace the \c pieSlice property in \c PieChart with a \c slices property,
-declared as a QDeclarativeListProperty type. The QDeclarativeListProperty class enables the
+declared as a QQmlListProperty type. The QQmlListProperty class enables the
creation of list properties in QML extensions. We replace the \c pieSlice()
function with a \c slices() function that returns a list of slices, and add
an internal \c append_slice() function (discussed below). We also use a QList to
@@ -372,9 +372,9 @@ store the internal list of slices as \c m_slices:
\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 2
Although the \c slices property does not have an associated \c WRITE function,
-it is still modifiable because of the way QDeclarativeListProperty works.
+it is still modifiable because of the way QQmlListProperty works.
In the \c PieChart implementation, we implement \c PieChart::slices() to
-return a QDeclarativeListProperty value and indicate that the internal
+return a QQmlListProperty value and indicate that the internal
\c PieChart::append_slice() function is to be called whenever a request is made from QML
to add items to the list:
@@ -382,7 +382,7 @@ to add items to the list:
The \c append_slice() function simply sets the parent item as before,
and adds the new item to the \c m_slices list. As you can see, the append function for a
-QDeclarativeListProperty is called with two arguments: the list property, and
+QQmlListProperty is called with two arguments: the list property, and
the item that is to be appended.
The \c PieSlice class has also been modified to include \c fromAngle and \c angleSpan
@@ -400,7 +400,7 @@ The complete code can be seen in the updated \c examples/tutorials/extending/cha
\example declarative/tutorials/extending/chapter6-plugins
Currently the \c PieChart and \c PieSlice types are used by \c app.qml,
-which is displayed using a QDeclarativeView in a C++ application. An alternative
+which is displayed using a QQuickView in a C++ application. An alternative
way to use our QML extension is to create a plugin library to make it available
to the QML engine. This allows \c app.qml to be loaded with the \l {QML Viewer}
(or some other QML \l{Qt Declarative UI Runtime}{runtime} application) instead of writing a \c main.cpp file and
@@ -414,8 +414,8 @@ To create a plugin library, we need:
\o A \l{Writing a qmldir file}{qmldir} file that tells the QML engine to load the plugin
\endlist
-First, we create a plugin class named \c ChartsPlugin. It subclasses QDeclarativeExtensionPlugin
-and registers our QML types in the inherited \l{QDeclarativeExtensionPlugin::}{registerTypes()} method. It also calls
+First, we create a plugin class named \c ChartsPlugin. It subclasses QQmlExtensionPlugin
+and registers our QML types in the inherited \l{QQmlExtensionPlugin::}{registerTypes()} method. It also calls
Q_EXPORT_PLUGIN2 for Qt's \l{How to Create Qt Plugins}{plugin system}.
Here is the \c ChartsPlugin definition in \c chartsplugin.h:
@@ -464,7 +464,7 @@ In this tutorial, we've shown the basic steps for creating a QML extension:
\o Add callable methods using Q_INVOKABLE or Qt slots, and connect to Qt signals with an \c onSignal syntax
\o Add property bindings by defining \l{Qt's Property System}{NOTIFY} signals
\o Define custom property types if the built-in types are not sufficient
-\o Define list property types using QDeclarativeListProperty
+\o Define list property types using QQmlListProperty
\o Create a plugin library by defining a Qt plugin and writing a \c qmldir file
\endlist
diff --git a/doc/src/qml/integrating.qdoc b/doc/src/qml/integrating.qdoc
index 7cd15a4fd4..2a88246006 100644
--- a/doc/src/qml/integrating.qdoc
+++ b/doc/src/qml/integrating.qdoc
@@ -38,13 +38,13 @@ depending on the characteristics of your existing UI code.
\section1 Integrating with a \l{QWidget}-based UI
If you have an existing QWidget-based UI, QML widgets can be integrated into
-it using QDeclarativeView. QDeclarativeView is a subclass of QWidget so you
+it using QQuickView. QQuickView is a subclass of QWidget so you
can add it to your user interface like any other QWidget. Use
-QDeclarativeView::setSource() to load a QML file into the view, then add the
+QQuickView::setSource() to load a QML file into the view, then add the
view to your UI:
\code
-QDeclarativeView *qmlView = new QDeclarativeView;
+QQuickView *qmlView = new QQuickView;
qmlView->setSource(QUrl::fromLocalFile("myqml.qml"));
QWidget *widget = myExistingWidget();
@@ -52,11 +52,11 @@ QVBoxLayout *layout = new QVBoxLayout(widget);
layout->addWidget(qmlView);
\endcode
-The one drawback to this approach is that QDeclarativeView is slower to initialize
-and uses more memory than a QWidget, and creating large numbers of QDeclarativeView
+The one drawback to this approach is that QQuickView is slower to initialize
+and uses more memory than a QWidget, and creating large numbers of QQuickView
objects may lead to performance degradation. If this is the case, it may be
better to rewrite your widgets in QML, and load the widgets from a main QML widget
-instead of using QDeclarativeView.
+instead of using QQuickView.
Keep in mind that QWidgets were designed for a different type of user interface
than QML, so it is not always a good idea to port a QWidget-based application to
@@ -71,7 +71,7 @@ of simple and dynamic elements.
If you have an existing UI based on the \l{Graphics View Framework},
you can integrate QML widgets directly into your QGraphicsScene. Use
-QDeclarativeComponent to create a QGraphicsObject from a QML file, and
+QQmlComponent to create a QGraphicsObject from a QML file, and
place the graphics object into your scene using \l{QGraphicsScene::addItem()}, or
reparent it to an item already in the \l{QGraphicsScene}.
@@ -79,8 +79,8 @@ For example:
\code
QGraphicsScene* scene = myExistingGraphicsScene();
-QDeclarativeEngine *engine = new QDeclarativeEngine;
-QDeclarativeComponent component(engine, QUrl::fromLocalFile("myqml.qml"));
+QQmlEngine *engine = new QQmlEngine;
+QQmlComponent component(engine, QUrl::fromLocalFile("myqml.qml"));
QGraphicsObject *object =
qobject_cast<QGraphicsObject *>(component.create());
scene->addItem(object);
diff --git a/doc/src/qml/javascriptblocks.qdoc b/doc/src/qml/javascriptblocks.qdoc
index 4cc98f1d7a..0c1d4c284c 100644
--- a/doc/src/qml/javascriptblocks.qdoc
+++ b/doc/src/qml/javascriptblocks.qdoc
@@ -200,8 +200,8 @@ in \c script.js:
\table
\row
-\o \snippet doc/src/snippets/declarative/integrating-javascript/connectjs.qml 0
-\o \snippet doc/src/snippets/declarative/integrating-javascript/script.js 0
+\o \snippet doc/src/snippets/qml/integrating-javascript/connectjs.qml 0
+\o \snippet doc/src/snippets/qml/integrating-javascript/script.js 0
\endtable
The \c jsFunction() will now be called whenever MouseArea's \c clicked signal is emitted.
@@ -222,7 +222,7 @@ Both relative and absolute JavaScript URLs can be imported. In the case of a
relative URL, the location is resolved relative to the location of the
\l {QML Document} that contains the import. If the script file is not accessible,
an error will occur. If the JavaScript needs to be fetched from a network
-resource, the component's \l {QDeclarativeComponent::status()}{status} is set to
+resource, the component's \l {QQmlComponent::status()}{status} is set to
"Loading" until the script has been downloaded.
Imported JavaScript files are always qualified using the "as" keyword. The
@@ -243,10 +243,10 @@ which in turn can call \c factorial() in \c factorial.js, as it has included
\table
\row
-\o {1,2} \snippet doc/src/snippets/declarative/integrating-javascript/includejs/app.qml 0
-\o \snippet doc/src/snippets/declarative/integrating-javascript/includejs/script.js 0
+\o {1,2} \snippet doc/src/snippets/qml/integrating-javascript/includejs/app.qml 0
+\o \snippet doc/src/snippets/qml/integrating-javascript/includejs/script.js 0
\row
-\o \snippet doc/src/snippets/declarative/integrating-javascript/includejs/factorial.js 0
+\o \snippet doc/src/snippets/qml/integrating-javascript/includejs/factorial.js 0
\endtable
Notice that calling \l {QML:Qt::include()}{Qt.include()} imports all functions from
@@ -479,11 +479,11 @@ themselves.
For the following examples, imagine that we have defined the following class:
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/avatarExample.h 0
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/avatarExample.h 0
and that we have registered it with the QML type-system as follows:
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/avatarExample.cpp 0
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 0
The AvatarExample class has a property which is a pixmap. When the property
is accessed in JavaScript scope, a copy of the resource will be created and
@@ -498,9 +498,9 @@ unless the client explicitly preserves it.
In the following example, the scarce resource will be automatically released
after the binding evaluation is complete.
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/exampleOne.qml 0
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/exampleOne.qml 0
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/avatarExample.cpp 1
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 1
\section2 Example Two: Automatic Release Prevented By Reference
@@ -509,9 +509,9 @@ released after the binding expression evaluation is
complete, because there is a property var referencing the
scarce resource.
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/exampleTwo.qml 0
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/exampleTwo.qml 0
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/avatarExample.cpp 2
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 2
\section2 Example Three: Explicit Preservation
@@ -519,11 +519,11 @@ In this example, the resource must be explicitly preserved in order
to prevent the declarative engine from automatically releasing the
resource after evaluation of the imported script.
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/exampleThree.js 0
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/exampleThree.js 0
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/exampleThree.qml 0
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/exampleThree.qml 0
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/avatarExample.cpp 3
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 3
\section2 Example Four: Explicit Destruction
@@ -532,11 +532,11 @@ scarce resource variant. This example shows how a client may free system
resources by releasing the scarce resource held in a JavaScript object, if
required, during evaluation of a JavaScript expression.
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/exampleFour.js 0
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/exampleFour.js 0
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/exampleFour.qml 0
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/exampleFour.qml 0
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/avatarExample.cpp 4
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 4
\section2 Example Five: Explicit Destruction And JavaScript References
@@ -546,8 +546,8 @@ to one scarce resource is held, and the client calls destroy() on one
of those references (to explicitly release the scarce resource), all of
the references will be affected.
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/exampleFive.qml 0
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/exampleFive.qml 0
-\snippet doc/src/snippets/declarative/integrating-javascript/scarceresources/avatarExample.cpp 5
+\snippet doc/src/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 5
*/
diff --git a/doc/src/qml/modules.qdoc b/doc/src/qml/modules.qdoc
index f75c03301c..27f8ae8fb1 100644
--- a/doc/src/qml/modules.qdoc
+++ b/doc/src/qml/modules.qdoc
@@ -45,14 +45,14 @@ example, an \c import statement is required to use:
\list
\o A component defined in another QML file that is not in the same directory
\o A component defined in a QML file located on a remote server
-\o A \l{QDeclarativeExtensionPlugin}{QML extension plugin} library (unless the plugin is installed in the same directory)
+\o A \l{QQmlExtensionPlugin}{QML extension plugin} library (unless the plugin is installed in the same directory)
\o A JavaScript file (note this must be imported using \l {#namespaces}{named imports})
\endlist
An \c import statement includes the module name, and possibly a version number.
This can be seen in the snippet commonly found at the top of QML files:
-\snippet doc/src/snippets/declarative/imports/qtquick-1.0.qml import
+\snippet doc/src/snippets/qml/imports/qtquick-1.0.qml import
This imports version 1.0 of the "QtQuick" module into the global namespace. (The QML
library itself must be imported to use any of the \l {QML Elements}, as they
@@ -111,7 +111,7 @@ Window {
Similarly, if the directory resided on a network source, it could
be imported like this:
-\snippet doc/src/snippets/declarative/imports/network-imports.qml imports
+\snippet doc/src/snippets/qml/imports/network-imports.qml imports
A located module can also be imported as a network resource if it has a
\l{Writing a qmldir file}{qmldir file} in the directory that specifies the QML files
@@ -145,7 +145,7 @@ a later version was used, as the \c qmldir file specifies that these elements
are only available in the 1.0 version.
Note that modules imported as a network resource allow only access to components
-defined in QML files; components defined by C++ \l{QDeclarativeExtensionPlugin}{QML extension plugins}
+defined in QML files; components defined by C++ \l{QQmlExtensionPlugin}{QML extension plugins}
are not available.
@@ -153,7 +153,7 @@ are not available.
\section1 Installed Modules
Installed modules are modules that are made available through the QML import path,
-as defined by QDeclarativeEngine::importPathList(), or modules defined within
+as defined by QQmlEngine::importPathList(), or modules defined within
C++ application code. An installed module is referred to by a URI, which allows
the module to be imported from QML code without specifying a complete filesystem
path or network resource URL.
@@ -161,7 +161,7 @@ path or network resource URL.
When importing an installed module, an un-quoted URI is
used, with a mandatory version number:
-\snippet doc/src/snippets/declarative/imports/installed-module.qml imports
+\snippet doc/src/snippets/qml/imports/installed-module.qml imports
When a module is imported, the QML engine searches the QML import path for a matching
module. The root directory of the module must contain a
@@ -177,7 +177,7 @@ module could be located under \c com/nokia/qml/mymodule.2/qmldir or
\c com/nokia/qml/mymodule.2.1/qmldir. The engine will automatically load
the module which matches best.
-The import path, as returned by QDeclarativeEngine::importPathList(), defines the default
+The import path, as returned by QQmlEngine::importPathList(), defines the default
locations to be searched by the QML engine for a matching module. By default, this list
contains:
@@ -187,7 +187,7 @@ contains:
\o Paths specified by the \c QML_IMPORT_PATH environment variable
\endlist
-Additional import paths can be added through QDeclarativeEngine::addImportPath() or the
+Additional import paths can be added through QQmlEngine::addImportPath() or the
\c QML_IMPORT_PATH environment variable. When running the \l {QML Viewer}, you
can also use the \c -I option to add an import path.
@@ -227,7 +227,7 @@ as \c http://www.some-server.com/qml and this URL was added to the QML import pa
QML code would work just the same.
Note that modules imported as a network resource allow only access to components
-defined in QML files; components defined by C++ \l{QDeclarativeExtensionPlugin}{QML extension plugins}
+defined in QML files; components defined by C++ \l{QQmlExtensionPlugin}{QML extension plugins}
are not available.
@@ -244,10 +244,10 @@ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
This allows the application's QML files to use the \c PieChart type by importing the declared
\c Charts module:
-\snippet doc/src/snippets/declarative/imports/chart.qml import
+\snippet doc/src/snippets/qml/imports/chart.qml import
-For \l{QDeclarativeExtensionPlugin}{QML plugins}, the
-module URI is automatically passed to QDeclarativeExtensionPlugin::registerTypes(). This method
+For \l{QQmlExtensionPlugin}{QML plugins}, the
+module URI is automatically passed to QQmlExtensionPlugin::registerTypes(). This method
can be reimplemented by the developer to register the necessary types for the module. Below is the
\c registerTypes() implementation from the \l{declarative/cppextensions/plugins}{QML plugins}
example:
@@ -257,7 +257,7 @@ example:
Once the plugin is built and installed, and includes a \l{Writing a qmldir file}{qmldir file},
the module can be imported from QML, like this:
-\snippet doc/src/snippets/declarative/imports/timeexample.qml import
+\snippet doc/src/snippets/qml/imports/timeexample.qml import
Unlike QML types defined by QML files, a QML type defined in a C++ extension plugin cannot be loaded by
a module that is imported as a network resource.
@@ -271,15 +271,15 @@ By default, when a module is imported, its contents are imported into the global
To import a module into a specific namespace, use the \i as keyword:
-\snippet doc/src/snippets/declarative/imports/named-imports.qml imports
+\snippet doc/src/snippets/qml/imports/named-imports.qml imports
Types from these modules can then only be used when qualified by the namespace:
-\snippet doc/src/snippets/declarative/imports/named-imports.qml imported items
+\snippet doc/src/snippets/qml/imports/named-imports.qml imported items
Multiple modules can be imported into the same namespace in the same way that multiple modules can be imported into the global namespace:
-\snippet doc/src/snippets/declarative/imports/merged-named-imports.qml imports
+\snippet doc/src/snippets/qml/imports/merged-named-imports.qml imports
\section2 JavaScript Files
@@ -381,14 +381,14 @@ into a Namespace exported by the module. The contents of the script file are ma
available inside the namespace <Namespace>, which has the version number
<InitialVersion>.
-\bold {plugin <Name> [<Path>]} lines are used to add \l{QDeclarativeExtensionPlugin}{QML C++ plugins} to the module. <Name> is the name of the library. It is usually not the same as the file name
+\bold {plugin <Name> [<Path>]} lines are used to add \l{QQmlExtensionPlugin}{QML C++ plugins} to the module. <Name> is the name of the library. It is usually not the same as the file name
of the plugin binary, which is platform dependent; e.g. the library \c MyAppTypes would produce
\c libMyAppTypes.so on Linux and \c MyAppTypes.dll on Windows.
<Path> is an optional argument specifying either an absolute path to the directory containing the
plugin file, or a relative path from the directory containing the \c qmldir file to the directory
containing the plugin file. By default the engine searches for the plugin library in the directory that contains the \c qmldir
-file. The plugin search path can be queried with QDeclarativeEngine::pluginPathList() and modified using QDeclarativeEngine::addPluginPath(). When running the \l {QML Viewer}, use the \c -P option to add paths to the plugin search path.
+file. The plugin search path can be queried with QQmlEngine::pluginPathList() and modified using QQmlEngine::addPluginPath(). When running the \l {QML Viewer}, use the \c -P option to add paths to the plugin search path.
\bold {typeinfo <File>} lines add \l{Writing a qmltypes file}{type description files} to
the module that can be read by QML tools such as Qt Creator to get information about the
@@ -434,7 +434,7 @@ to \c /tmp/imports/My/Module/qmldir to register it.
While the qmldump tool covers most cases, it does not work if:
\list
-\o The plugin uses a \l{QDeclarativeCustomParser}. The component that uses
+\o The plugin uses a \l{QQmlCustomParser}. The component that uses
the custom parser will not get its members documented.
\o The plugin can not be loaded. In particular if you cross-compiled
the plugin for a different architecture, qmldump will not be able to
@@ -456,7 +456,7 @@ Module {
// The name is a unique identifier used to refer to this type.
// It is recommended you simply use the C++ type name.
- name: "QDeclarativeAbstractAnimation"
+ name: "QQuickAbstractAnimation"
// The name of the prototype Component.
prototype: "QObject"
@@ -492,12 +492,12 @@ Module {
Property {
name: "animations";
- type: "QDeclarativeAbstractAnimation"
+ type: "QQuickAbstractAnimation"
// defaults to false, whether this property is read only
isReadonly: true
// defaults to false, whether the type of this property was a pointer in C++
isPointer: true
- // defaults to false: whether the type actually is a QDeclarativeListProperty<type>
+ // defaults to false: whether the type actually is a QQmlListProperty<type>
isList: true
// defaults to 0: the meta object revision that introduced this property
revision: 1
diff --git a/doc/src/qml/network.qdoc b/doc/src/qml/network.qdoc
index 15a17203c3..71f42a4bfe 100644
--- a/doc/src/qml/network.qdoc
+++ b/doc/src/qml/network.qdoc
@@ -118,11 +118,11 @@ See the \tt examples/declarative/flickr for a real demonstration of this.
\section1 Configuring the Network Access Manager
-All network access from QML is managed by a QNetworkAccessManager set on the QDeclarativeEngine which executes the QML.
+All network access from QML is managed by a QNetworkAccessManager set on the QQmlEngine which executes the QML.
By default, this is an unmodified Qt QNetworkAccessManager. You may set a different manager by
-providing a QDeclarativeNetworkAccessManagerFactory and setting it via
-QDeclarativeEngine::setNetworkAccessManagerFactory().
-For example, the \l {QML Viewer} sets a QDeclarativeNetworkAccessManagerFactory which
+providing a QQmlNetworkAccessManagerFactory and setting it via
+QQmlEngine::setNetworkAccessManagerFactory().
+For example, the \l {QML Viewer} sets a QQmlNetworkAccessManagerFactory which
creates QNetworkAccessManager that trusts HTTP Expiry headers to avoid network cache checks,
allows HTTP Pipelining, adds a persistent HTTP CookieJar, a simple disk cache, and supports proxy settings.
@@ -134,7 +134,7 @@ the executable using \l{The Qt Resource System}. Using this, an executable can r
that is compiled into the executable:
\code
- QDeclarativeView *canvas = new QDeclarativeView;
+ QQuickView *canvas = new QQuickView;
canvas->setUrl(QUrl("qrc:/dial.qml"));
\endcode
diff --git a/doc/src/qml/propertybinding.qdoc b/doc/src/qml/propertybinding.qdoc
index b89b3d7a61..6dd862f55b 100644
--- a/doc/src/qml/propertybinding.qdoc
+++ b/doc/src/qml/propertybinding.qdoc
@@ -44,10 +44,10 @@ The syntax for properties is:
Elements already possess useful properties but, to create custom properties,
precede the property name with the keyword \c property.
-\snippet doc/src/snippets/declarative/properties.qml parent begin
-\snippet doc/src/snippets/declarative/properties.qml inherited properties
-\snippet doc/src/snippets/declarative/properties.qml custom properties
-\snippet doc/src/snippets/declarative/properties.qml parent end
+\snippet doc/src/snippets/qml/properties.qml parent begin
+\snippet doc/src/snippets/qml/properties.qml inherited properties
+\snippet doc/src/snippets/qml/properties.qml custom properties
+\snippet doc/src/snippets/qml/properties.qml parent end
QML property rules coincide with many of JavaScript's property rules, for example,
property names must begin with a lowercase letter.
@@ -62,14 +62,14 @@ to other property values or data accessible in the application. The property val
automatically kept up to date if the other properties or data values change.
Property bindings are created in QML using the colon "\c {:}" before the value:
-\snippet doc/src/snippets/declarative/properties.qml property binding
+\snippet doc/src/snippets/qml/properties.qml property binding
The property binding causes the width of the \c Rectangle to update whenever the
\c {parent}'s width changes.
QML extends a standards compliant JavaScript engine, so any valid JavaScript expression can be
used as a property binding. Bindings can access object properties, make function calls and even
use built-in JavaScript objects such as \c {Date} and \c {Math}.
-\snippet doc/src/snippets/declarative/properties.qml JavaScript sample
+\snippet doc/src/snippets/qml/properties.qml JavaScript sample
While syntactically bindings can be of arbitrary complexity, if a binding starts to become
overly complex - such as involving multiple lines, or imperative loops - it may be better
@@ -82,13 +82,13 @@ function.
When working with both QML and JavaScript, it is important to differentiate between
QML property binding and JavaScript value assignment. In QML, a property
binding is created using the colon "\c {:}".
-\snippet doc/src/snippets/declarative/properties.qml property binding
+\snippet doc/src/snippets/qml/properties.qml property binding
The property binding causes the width of the \c Rectangle to update whenever the
\c {parent}'s width changes.
Assigning a property value (using the equals sign "\c {=}") does not create a
property binding.
-\snippet doc/src/snippets/declarative/properties.qml property assignment
+\snippet doc/src/snippets/qml/properties.qml property assignment
Instead of creating a property binding, the assignment simply sets the \c Rectangle
\c width value to a number when the \c Component.onCompleted code is invoked.
@@ -186,7 +186,7 @@ Care must be taken when referring to the parent of an object property binding.
Elements and components that are bound to properties are not necessarily set
as children of the properties' component.
-\snippet doc/src/snippets/declarative/properties.qml object binding
+\snippet doc/src/snippets/qml/properties.qml object binding
The code snippet has a \l Gradient element that attempts to print its parent's
\c width value. However, the \c Gradient element is bound to the \c gradient
property, not the \c children property of the \c Rectangle. As a result, the
@@ -205,7 +205,7 @@ Certain objects provide additional properties by \i attaching properties to othe
objects. For example, the \l Keys element have properties that can \i attach to other QML
objects to provide keyboard handling.
-\snippet doc/src/snippets/declarative/properties.qml list attached property
+\snippet doc/src/snippets/qml/properties.qml list attached property
The element \l ListView provides the delegate, \c listdelegate, the property
\c isCurrentItem as an attached property. The \c ListView.isCurrentItem
\i{attached property} provides highlight information to the delegate.
@@ -221,7 +221,7 @@ to provide additional functionality to objects. Two prominent elements,
\l Component and \l Keys element provide
\l{QML Signal and Handler Event System}{signal handlers} as attached signal
handlers.
-\snippet doc/src/snippets/declarative/properties.qml attached signal handler
+\snippet doc/src/snippets/qml/properties.qml attached signal handler
Read the \l{QML Signal and Handler Event System} and the \l{Keyboard Focus in QML}
articles for more information.
@@ -232,14 +232,14 @@ Some properties may accept a binding to a list property, where more than one
component can bind to the property. List properties allow multiple
\l {State}{States}, \l {Gradient}{Gradients}, and other components to bind to a
single property.
-\snippet doc/src/snippets/declarative/properties.qml list property
+\snippet doc/src/snippets/qml/properties.qml list property
The list is enclosed in square brackets, with a comma separating the
list elements. In cases where you are only assigning a single item to a
list, you may omit the square brackets.
-\snippet doc/src/snippets/declarative/properties.qml single property
+\snippet doc/src/snippets/qml/properties.qml single property
To access the list, use the \c index property.
-\snippet doc/src/snippets/declarative/properties.qml print list property
+\snippet doc/src/snippets/qml/properties.qml print list property
The snippet code simply prints the name of the first state, \c FETCH.
See the \l{list}{list type} documentation
@@ -252,7 +252,7 @@ In some cases properties form a logical group and use either the \i dot notation
or \i group notation.
Grouped properties may be written both ways:
-\snippet doc/src/snippets/declarative/properties.qml grouped properties
+\snippet doc/src/snippets/qml/properties.qml grouped properties
In the element documentation grouped properties are shown using the dot notation.
@@ -275,18 +275,18 @@ Accessing the aliasing property is similar to accessing a regular property. In
addition, the optional \c default keyword indicates that the aliasing property
is a \l{Default Properties}{default property}.
-\snippet doc/src/snippets/declarative/Button.qml property alias
+\snippet doc/src/snippets/qml/Button.qml property alias
When importing the component as a \c Button, the \c buttonlabel is directly
accessible through the \c label property.
-\snippet doc/src/snippets/declarative/properties.qml alias usage
+\snippet doc/src/snippets/qml/properties.qml alias usage
In addition, the \c id property may also be aliased and referred outside the
component.
-\snippet doc/src/snippets/declarative/Button.qml parent begin
-\snippet doc/src/snippets/declarative/Button.qml id alias
-\snippet doc/src/snippets/declarative/Button.qml parent end
+\snippet doc/src/snippets/qml/Button.qml parent begin
+\snippet doc/src/snippets/qml/Button.qml id alias
+\snippet doc/src/snippets/qml/Button.qml parent end
The \c imagebutton component has the ability to modify the child \l Image object
and its properties.
-\snippet doc/src/snippets/declarative/properties.qml image alias
+\snippet doc/src/snippets/qml/properties.qml image alias
Using aliases, properties may be exposed to the
\l{qml-top-level-component}{top level component}. Exposing properties to the
@@ -299,7 +299,7 @@ Aliases are only activated once the component
when an uninitialized alias is referenced. Likewise, aliasing an aliasing
property will also result in an error.
-\snippet doc/src/snippets/declarative/properties.qml alias complete
+\snippet doc/src/snippets/qml/properties.qml alias complete
When importing the component, however, aliasing properties appear as regular Qt
properties and consequently can be used in alias references.
@@ -309,7 +309,7 @@ property, effectively overwriting the existing property. For example,
the following component has a \c color alias property, named the same as the built-in
\l {Rectangle::color} property:
-\snippet doc/src/snippets/declarative/properties.qml alias overwrite
+\snippet doc/src/snippets/qml/properties.qml alias overwrite
Any object that use this component and refer to its \c color property will be
referring to the alias rather than the ordinary \l {Rectangle::color} property.
@@ -328,13 +328,13 @@ as the \i {default property}. For example, the State element's default property
is its \l{State::changes}{changes} property. \l PropertyChanges elements
may simply be placed as the \c{State}'s children and they will be bound to the
\c changes property.
-\snippet doc/src/snippets/declarative/properties.qml state default
+\snippet doc/src/snippets/qml/properties.qml state default
Similarly, the \l Item element's default property is its
\l{Item::data}{data} property. The \c data property manages Item's
\c children and \c resources properties. This way, different data types may be
placed as direct children of the \c Item.
-\snippet doc/src/snippets/declarative/properties.qml default property
+\snippet doc/src/snippets/qml/properties.qml default property
Reassigning a default property is useful when a component is reused. For
example, the \l{declarative/ui-components/tabwidget}{TabWidget} example uses
@@ -350,14 +350,14 @@ For example, to bind a property exposed from the \l{The QML Engine}{declarative
runtime} or \l{QmlGlobalQtObject}{Qt object}, such as the \c system.brightness
property, to a value written in QML, you could use the \l Binding element as
follows:
-\snippet doc/src/snippets/declarative/properties.qml binding element
+\snippet doc/src/snippets/qml/properties.qml binding element
\section1 Changing Property Values in States
The \l PropertyChanges element is for setting property bindings within a
\l State element to set a property binding.
-\snippet doc/src/snippets/declarative/properties.qml PropertyChanges element
+\snippet doc/src/snippets/qml/properties.qml PropertyChanges element
The rectangle's \c color property will bind to the \c warning component's
\c color property when its \c state is set to the \c WARNING state.
*/
diff --git a/doc/src/qml/qmlcomponents.qdoc b/doc/src/qml/qmlcomponents.qdoc
index bcc465f4b2..21b94f2ae3 100644
--- a/doc/src/qml/qmlcomponents.qdoc
+++ b/doc/src/qml/qmlcomponents.qdoc
@@ -50,7 +50,7 @@ is the emphasis in QML.
Any snippet of QML code may become a component, by placing the code in a QML
file, whose file extension is \c .qml). A complete Button component that
responds to user input may be in a Button.qml file.
-\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml document
+\snippet doc/src/snippets/qml/reusablecomponents/Button.qml document
The component name, \c Button, matches the QML filename, \c Button.qml.
Also, the first character is in upper case. Matching the names allow
@@ -60,9 +60,9 @@ naming components with different filenames.
Alternatively, a \l Component element may encapsulate a QML object to form a
component.
-\snippet doc/src/snippets/declarative/reusablecomponents/component.qml parent begin
-\snippet doc/src/snippets/declarative/reusablecomponents/component.qml define inline component
-\snippet doc/src/snippets/declarative/reusablecomponents/component.qml parent end
+\snippet doc/src/snippets/qml/reusablecomponents/component.qml parent begin
+\snippet doc/src/snippets/qml/reusablecomponents/component.qml define inline component
+\snippet doc/src/snippets/qml/reusablecomponents/component.qml parent end
Components may incorporate any \l{Qt Quick}{QML feature} such as:
@@ -89,7 +89,7 @@ A component defined in a \c .qml file is directly usable by declaring the name
of the component. For example, a button defined in \c Button.qml is created by
declaring a \c Button. The button is defined in the
\l {qml-define-components}{Defining New Components} section.
-\snippet doc/src/snippets/declarative/reusablecomponents/application.qml document
+\snippet doc/src/snippets/qml/reusablecomponents/application.qml document
Note that the component name, \c Button, matches the QML filename, \c Button.qml.
Also, the first character is in upper case. Matching the names allow
@@ -100,7 +100,7 @@ For flexibility, a \c qmldir file is for dictating which additional components,
plugins, or directories should be imported. By using a \c qmldir file, component
names do not need to match the filenames. The \c qmldir file should, however, be
in an imported path.
-\snippet doc/src/snippets/declarative/reusablecomponents/qmldir document
+\snippet doc/src/snippets/qml/reusablecomponents/qmldir document
\section2 Loading an Inline Component
@@ -109,8 +109,8 @@ delayed. A component may be created during a MouseArea event or by using a
\l Loader element. The component can create an object, which is addressable in a
similar way as an \l {qml-id}{identifier}. Thus, the created object may
have its bindings set and read like a normal QML object.
-\snippet doc/src/snippets/declarative/reusablecomponents/component.qml define inline component
-\snippet doc/src/snippets/declarative/reusablecomponents/component.qml create inline component
+\snippet doc/src/snippets/qml/reusablecomponents/component.qml define inline component
+\snippet doc/src/snippets/qml/reusablecomponents/component.qml create inline component
\keyword qml-component-properties
\section1 Component Properties
@@ -140,11 +140,11 @@ Consider the Button component from the
object is a \l Rectangle. When imported, the Button component will possess the
Rectangle's properties, methods, signals, and any custom properties.
-\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml parent begin
-\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml ellipses
-\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml properties
-\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml ellipses
-\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml parent end
+\snippet doc/src/snippets/qml/reusablecomponents/Button.qml parent begin
+\snippet doc/src/snippets/qml/reusablecomponents/Button.qml ellipses
+\snippet doc/src/snippets/qml/reusablecomponents/Button.qml properties
+\snippet doc/src/snippets/qml/reusablecomponents/Button.qml ellipses
+\snippet doc/src/snippets/qml/reusablecomponents/Button.qml parent end
The Button's \c text alias is accessible from outside the component as well as
the Rectangle's visual properties and signals such as \c x, \c y, \c anchors,
@@ -156,7 +156,7 @@ children which is beneficial for certain types of interfaces. However, since
\c FocusScopes are not visual elements, the visual properties of its child need
to be exposed.
-\snippet doc/src/snippets/declarative/reusablecomponents/focusbutton.qml document
+\snippet doc/src/snippets/qml/reusablecomponents/focusbutton.qml document
\keyword qml-id
\section2 The Object Identifier
@@ -165,7 +165,7 @@ Each QML object may be given a special unique identifier called an \c id.
No other object within the same QML component (see \l{QML Documents}) can have
the same \c id value. QML objects may then access an object using the \c id
property.
-\snippet doc/src/snippets/declarative/properties.qml id property
+\snippet doc/src/snippets/qml/properties.qml id property
A component may readily access its parent's properties by using the \c parent
property.
@@ -178,15 +178,15 @@ Note that an \c id must begin with a lower-case letter or an underscore. The
Objects or Items declared within a component can be made accessible by binding their id to a
property alias.
-\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml parent begin
-\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml object alias
-\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml text
-\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml parent end
+\snippet doc/src/snippets/qml/reusablecomponents/Button.qml parent begin
+\snippet doc/src/snippets/qml/reusablecomponents/Button.qml object alias
+\snippet doc/src/snippets/qml/reusablecomponents/Button.qml text
+\snippet doc/src/snippets/qml/reusablecomponents/Button.qml parent end
The advantage of using an alias instead a property of type of the object is that the value of
the alias cannot be overridden, and members of the object can be used in property bindings when
declaring an instance of the component.
-\snippet doc/src/snippets/declarative/reusablecomponents/application.qml grouped property
+\snippet doc/src/snippets/qml/reusablecomponents/application.qml grouped property
If a property of type \c Text was used instead of an alias in this instance there would be no
guarantee that \c label would be initialized before the binding was attempted which would cause
the binding to fail.
diff --git a/doc/src/qml/qmldocument.qdoc b/doc/src/qml/qmldocument.qdoc
index fedeba35e1..426f135a45 100644
--- a/doc/src/qml/qmldocument.qdoc
+++ b/doc/src/qml/qmldocument.qdoc
@@ -36,7 +36,7 @@ from text data.
Here is a simple QML document:
-\snippet doc/src/snippets/declarative/qml-documents/non-trivial.qml document
+\snippet doc/src/snippets/qml/qml-documents/non-trivial.qml document
QML documents are always encoded in UTF-8 format.
@@ -79,7 +79,7 @@ text property:
\o application.qml
\row
-\o \snippet doc/src/snippets/declarative/qml-documents/qmldocuments.qml document
+\o \snippet doc/src/snippets/qml/qml-documents/qmldocuments.qml document
\o
\qml
import QtQuick 2.0
@@ -138,14 +138,14 @@ These final two examples perform identically to the original document.
\table
\row
\o
-\snippet doc/src/snippets/declarative/qml-documents/inline-component.qml document
+\snippet doc/src/snippets/qml/qml-documents/inline-component.qml document
\o
-\snippet doc/src/snippets/declarative/qml-documents/inline-text-component.qml document
+\snippet doc/src/snippets/qml/qml-documents/inline-text-component.qml document
\endtable
For information about components, the \l{QML Components} article details the
creation of components and how to load them in other components.
-\sa QDeclarativeComponent
+\sa QQmlComponent
*/
diff --git a/doc/src/qml/qmlengine.qdoc b/doc/src/qml/qmlengine.qdoc
index 3e8ef1ae3f..0865755c7b 100644
--- a/doc/src/qml/qmlengine.qdoc
+++ b/doc/src/qml/qmlengine.qdoc
@@ -38,16 +38,16 @@ specified in QML files, plugins, or applications.
\section1 Core Module Classes
- The \l{QtDeclarative}{Qt Declarative} module provides a set of C++ APIs for
+ The \l{QtQml}{Qt Declarative} module provides a set of C++ APIs for
extending your QML applications from C++ and embedding QML into C++
applications. There are several core classes in the Qt Declarative module
that provide the essential capabilities for doing this. These are:
\list
- \o QDeclarativeEngine: A QML engine provides the environment for executing QML code. Every
+ \o QQmlEngine: A QML engine provides the environment for executing QML code. Every
application requires at least one engine instance.
- \o QDeclarativeComponent: A component encapsulates QML information.
- \o QDeclarativeContext: A context allows an application to expose data to
+ \o QQmlComponent: A component encapsulates QML information.
+ \o QQmlContext: A context allows an application to expose data to
the QML components created by an engine.
\endlist
@@ -61,27 +61,27 @@ specified in QML files, plugins, or applications.
\endlist
\section2 Declarative Engine
- A QDeclarativeEngine allows the configuration of global settings that
+ A QQmlEngine allows the configuration of global settings that
apply to all of its QML component instances: for example, the
QNetworkAccessManager to be used for network communications, and the
file path to be used for persistent storage.
- QDeclarativeComponent is used to load QML documents. Each
- QDeclarativeComponent instance represents a single document. A component
+ QQmlComponent is used to load QML documents. Each
+ QQmlComponent instance represents a single document. A component
can be created from the URL or file path of a QML document, or the raw
QML code of the document. Component instances are instatiated through
- the QDeclarativeComponent::create() method, like this:
+ the QQmlComponent::create() method, like this:
\code
- QDeclarativeEngine engine;
- QDeclarativeComponent component(&engine, QUrl::fromLocalFile("MyRectangle.qml"));
+ QQmlEngine engine;
+ QQmlComponent component(&engine, QUrl::fromLocalFile("MyRectangle.qml"));
QObject *rectangleInstance = component.create();
// ...
delete rectangleInstance;
\endcode
- QML documents can also be loaded using QDeclarativeView. This class
+ QML documents can also be loaded using QQuickView. This class
provides a convenient QWidget-based view for embedding QML components
into QGraphicsView-based applications. (For other methods of integrating
QML into QWidget-based applications, see \l {Integrating QML Code with
@@ -91,44 +91,44 @@ specified in QML files, plugins, or applications.
\section2 Loading QML Components from C++
- A QML document can be loaded with QDeclarativeComponent or QDeclarativeView.
- QDeclarativeComponent loads a QML component as a C++ object;
- QDeclarativeView also does this, but additionally loads the QML component
+ A QML document can be loaded with QQmlComponent or QQuickView.
+ QQmlComponent loads a QML component as a C++ object;
+ QQuickView also does this, but additionally loads the QML component
directly into a QGraphicsView. It is convenient for loading a displayable
QML component into a QWidget-based application.
For example, suppose there is a \c MyItem.qml file that looks like this:
- \snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml start
- \snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml end
+ \snippet doc/src/snippets/qml/qtbinding/loading/MyItem.qml start
+ \snippet doc/src/snippets/qml/qtbinding/loading/MyItem.qml end
- This QML document can be loaded with QDeclarativeComponent or
- QDeclarativeView with the following C++ code. Using a QDeclarativeComponent
- requires calling QDeclarativeComponent::create() to create a new instance of
- the component, while a QDeclarativeView automatically creates an instance of
- the component, which is accessible via QDeclarativeView::rootObject():
+ This QML document can be loaded with QQmlComponent or
+ QQuickView with the following C++ code. Using a QQmlComponent
+ requires calling QQmlComponent::create() to create a new instance of
+ the component, while a QQuickView automatically creates an instance of
+ the component, which is accessible via QQuickView::rootObject():
\table
\row
\o
- \snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp QDeclarativeComponent-a
+ \snippet doc/src/snippets/qml/qtbinding/loading/main.cpp QQmlComponent-a
\dots 0
- \snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp QDeclarativeComponent-b
+ \snippet doc/src/snippets/qml/qtbinding/loading/main.cpp QQmlComponent-b
\o
- \snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp QDeclarativeView
+ \snippet doc/src/snippets/qml/qtbinding/loading/main.cpp QQuickView
\endtable
This \c object is the instance of the \c MyItem.qml component that has been
created. You can now modify the item's properties using
- QObject::setProperty() or QDeclarativeProperty:
+ QObject::setProperty() or QQmlProperty:
- \snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp properties
+ \snippet doc/src/snippets/qml/qtbinding/loading/main.cpp properties
Alternatively, you can cast the object to its actual type and call functions
with compile-time safety. In this case the base object of \c MyItem.qml is
- an \l Item, which is defined by the QDeclarativeItem class:
+ an \l Item, which is defined by the QQuickItem class:
- \snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp cast
+ \snippet doc/src/snippets/qml/qtbinding/loading/main.cpp cast
You can also connect to any signals or call functions defined in the
component using QMetaObject::invokeMethod() and QObject::connect(). See \l
@@ -141,14 +141,14 @@ specified in QML files, plugins, or applications.
the QObject::objectName property with QObject::findChild(). For example, if
the root item in \c MyItem.qml had a child \l Rectangle item:
- \snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml start
+ \snippet doc/src/snippets/qml/qtbinding/loading/MyItem.qml start
\codeline
- \snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml child
- \snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml end
+ \snippet doc/src/snippets/qml/qtbinding/loading/MyItem.qml child
+ \snippet doc/src/snippets/qml/qtbinding/loading/MyItem.qml end
The child could be located like this:
- \snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp findChild
+ \snippet doc/src/snippets/qml/qtbinding/loading/main.cpp findChild
If \c objectName is used inside a delegate of a ListView, \l Repeater or
some other element that creates multiple instances of its delegates, there
@@ -172,20 +172,20 @@ specified in QML files, plugins, or applications.
\section2 Embedding C++ Objects into QML Components
When loading a QML scene into a C++ application, it can be useful to
- directly embed C++ data into the QML object. QDeclarativeContext enables
+ directly embed C++ data into the QML object. QQmlContext enables
this by exposing data to the context of a QML component, allowing data to be
injected from C++ into QML.
For example, here is a QML item that refers to a \c currentDateTime value
that does not exist in the current scope:
- \snippet doc/src/snippets/declarative/qtbinding/context/MyItem.qml 0
+ \snippet doc/src/snippets/qml/qtbinding/context/MyItem.qml 0
This \c currentDateTime value can be set directly by the C++ application
that loads the QML component, using
- QDeclarativeContext::setContextProperty():
+ QQmlContext::setContextProperty():
- \snippet doc/src/snippets/declarative/qtbinding/context/main.cpp 0
+ \snippet doc/src/snippets/qml/qtbinding/context/main.cpp 0
Context properties can hold either QVariant or QObject* values. This means
custom C++ objects can also be injected using this approach, and these
@@ -196,11 +196,11 @@ specified in QML files, plugins, or applications.
\table
\row
\o
- \snippet doc/src/snippets/declarative/qtbinding/context-advanced/applicationdata.h 0
+ \snippet doc/src/snippets/qml/qtbinding/context-advanced/applicationdata.h 0
\codeline
- \snippet doc/src/snippets/declarative/qtbinding/context-advanced/main.cpp 0
+ \snippet doc/src/snippets/qml/qtbinding/context-advanced/main.cpp 0
\o
- \snippet doc/src/snippets/declarative/qtbinding/context-advanced/MyItem.qml 0
+ \snippet doc/src/snippets/qml/qtbinding/context-advanced/MyItem.qml 0
\endtable
(Note that date/time values returned from C++ to QML can be formatted through
@@ -212,7 +212,7 @@ specified in QML files, plugins, or applications.
connected to using an \c onDataChanged handler within a \l Connections
object:
- \snippet doc/src/snippets/declarative/qtbinding/context-advanced/connections.qml 0
+ \snippet doc/src/snippets/qml/qtbinding/context-advanced/connections.qml 0
Context properties can be useful for using C++ based data models in a QML view. See the
\l {declarative/modelviews/stringlistmodel}{String ListModel},
@@ -221,7 +221,7 @@ specified in QML files, plugins, or applications.
respective examples on using QStringListModel, QObjectList-based models and QAbstractItemModel
in QML views.
- Also see the QDeclarativeContext documentation for more information.
+ Also see the QQmlContext documentation for more information.
\section1 Invoking QML Entities through the Engine
@@ -246,8 +246,8 @@ specified in QML files, plugins, or applications.
\table
\row
- \o \snippet doc/src/snippets/declarative/qtbinding/functions-qml/MyItem.qml 0
- \o \snippet doc/src/snippets/declarative/qtbinding/functions-qml/main.cpp 0
+ \o \snippet doc/src/snippets/qml/qtbinding/functions-qml/MyItem.qml 0
+ \o \snippet doc/src/snippets/qml/qtbinding/functions-qml/main.cpp 0
\endtable
Notice the Q_RETURN_ARG() and Q_ARG() arguments for
@@ -257,16 +257,16 @@ specified in QML files, plugins, or applications.
To call a C++ function from QML, the function must be either a Qt slot, or a
function marked with the Q_INVOKABLE macro, to be available to QML. In the
following example, the QML code invokes methods on the \c myObject object,
- which has been set using QDeclarativeContext::setContextProperty():
+ which has been set using QQmlContext::setContextProperty():
\table
\row
\o
- \snippet doc/src/snippets/declarative/qtbinding/functions-cpp/MyItem.qml 0
+ \snippet doc/src/snippets/qml/qtbinding/functions-cpp/MyItem.qml 0
\o
- \snippet doc/src/snippets/declarative/qtbinding/functions-cpp/myclass.h 0
+ \snippet doc/src/snippets/qml/qtbinding/functions-cpp/myclass.h 0
\codeline
- \snippet doc/src/snippets/declarative/qtbinding/functions-cpp/main.cpp 0
+ \snippet doc/src/snippets/qml/qtbinding/functions-cpp/main.cpp 0
\endtable
QML supports the calling of overloaded C++ functions. If there are multiple
@@ -289,11 +289,11 @@ specified in QML files, plugins, or applications.
\table
\row
\o
- \snippet doc/src/snippets/declarative/qtbinding/signals-qml/MyItem.qml 0
+ \snippet doc/src/snippets/qml/qtbinding/signals-qml/MyItem.qml 0
\o
- \snippet doc/src/snippets/declarative/qtbinding/signals-qml/myclass.h 0
+ \snippet doc/src/snippets/qml/qtbinding/signals-qml/myclass.h 0
\codeline
- \snippet doc/src/snippets/declarative/qtbinding/signals-qml/main.cpp 0
+ \snippet doc/src/snippets/qml/qtbinding/signals-qml/main.cpp 0
\endtable
To connect to Qt C++ signals from within QML, use a signal handler with the
@@ -308,12 +308,12 @@ specified in QML files, plugins, or applications.
\row
\o
- \snippet doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h start
+ \snippet doc/src/snippets/qml/qtbinding/signals-cpp/imageviewer.h start
\dots 4
- \snippet doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h end
+ \snippet doc/src/snippets/qml/qtbinding/signals-cpp/imageviewer.h end
\o
- \snippet doc/src/snippets/declarative/qtbinding/signals-cpp/standalone.qml 0
+ \snippet doc/src/snippets/qml/qtbinding/signals-cpp/standalone.qml 0
\endtable
(Note that if a signal has been declared as the NOTIFY signal for a
@@ -326,13 +326,13 @@ specified in QML files, plugins, or applications.
If, however, the object with the signal is not created from within the QML
code, and the QML item only has a reference to the created object - for
example, if the object was set using
- QDeclarativeContext::setContextProperty() - then the \l Connections element
+ QQmlContext::setContextProperty() - then the \l Connections element
can be used instead to create the signal handler:
\table
\row
- \o \snippet doc/src/snippets/declarative/qtbinding/signals-cpp/main.cpp connections
- \o \snippet doc/src/snippets/declarative/qtbinding/signals-cpp/MyItem.qml 0
+ \o \snippet doc/src/snippets/qml/qtbinding/signals-cpp/main.cpp connections
+ \o \snippet doc/src/snippets/qml/qtbinding/signals-cpp/MyItem.qml 0
\endtable
C++ signals can use enum values as parameters provided that the enum is
@@ -346,14 +346,14 @@ specified in QML files, plugins, or applications.
Any properties declared in a QML object are automatically accessible from
C++. Given a QML item like this:
- \snippet doc/src/snippets/declarative/qtbinding/properties-qml/MyItem.qml 0
+ \snippet doc/src/snippets/qml/qtbinding/properties-qml/MyItem.qml 0
The value of the \c someNumber property can be set and read using
- QDeclarativeProperty, or QObject::setProperty() and QObject::property():
+ QQmlProperty, or QObject::setProperty() and QObject::property():
- \snippet doc/src/snippets/declarative/qtbinding/properties-qml/main.cpp 0
+ \snippet doc/src/snippets/qml/qtbinding/properties-qml/main.cpp 0
- You should always use QObject::setProperty(), QDeclarativeProperty or
+ You should always use QObject::setProperty(), QQmlProperty or
QMetaProperty::write() to change a QML property value, to ensure the QML
engine is made aware of the property change. For example, say you have a
custom element \c PushButton with a \c buttonText property that internally
@@ -362,7 +362,7 @@ specified in QML files, plugins, or applications.
\badcode
// BAD!
- QDeclarativeComponent component(engine, "MyButton.qml");
+ QQmlComponent component(engine, "MyButton.qml");
PushButton *button = qobject_cast<PushButton*>(component.create());
button->m_buttonText = "Click me";
\endcode
@@ -381,8 +381,8 @@ specified in QML files, plugins, or applications.
\table
\row
- \o \snippet doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h 0
- \o \snippet doc/src/snippets/declarative/qtbinding/properties-cpp/MyItem.qml 0
+ \o \snippet doc/src/snippets/qml/qtbinding/properties-cpp/applicationdata.h 0
+ \o \snippet doc/src/snippets/qml/qtbinding/properties-cpp/MyItem.qml 0
\endtable
Notice the \c backgroundColorChanged signal is declared as the NOTIFY signal
@@ -401,7 +401,7 @@ specified in QML files, plugins, or applications.
Additional Qt code is runnable in the engine as a QML plugin. The \l{QML
Plugins} article covers the creation and usage patterns of QML plugins. The
- QDeclarativeExtensionPlugin class is an abstract class for writing QML
+ QQmlExtensionPlugin class is an abstract class for writing QML
plugins. The \l {How to Create Qt Plugins} contains more information about
Qt's plugin system.
@@ -413,17 +413,17 @@ specified in QML files, plugins, or applications.
initializing some costly data structures until after all the properties have
been set.
- The QML engine defines an interface class called QDeclarativeParserStatus,
+ The QML engine defines an interface class called QQmlParserStatus,
which contains a number of virtual methods that are invoked at various
stages during component instantiation. To receive these notifications, an
- element implementation inherits QDeclarativeParserStatus and notifies the Qt
+ element implementation inherits QQmlParserStatus and notifies the Qt
meta system using the Q_INTERFACES() macro.
\code
- class Example : public QObject, public QDeclarativeParserStatus
+ class Example : public QObject, public QQmlParserStatus
{
Q_OBJECT
- Q_INTERFACES(QDeclarativeParserStatus)
+ Q_INTERFACES(QQmlParserStatus)
public:
virtual void componentComplete()
{
diff --git a/doc/src/qml/qmlevents.qdoc b/doc/src/qml/qmlevents.qdoc
index f29b2f260b..1f2e7a9908 100644
--- a/doc/src/qml/qmlevents.qdoc
+++ b/doc/src/qml/qmlevents.qdoc
@@ -58,9 +58,9 @@ Attempting to declare two signals or methods with the same name in the same type
block generates an error. However, a new signal may reuse the name of an existing signal on the type. (This should be done with caution, as the existing signal may be hidden and become inaccessible.)
Here are various examples of signal declarations:
-\snippet doc/src/snippets/declarative/events.qml parent begin
-\snippet doc/src/snippets/declarative/events.qml signal declaration
-\snippet doc/src/snippets/declarative/events.qml parent end
+\snippet doc/src/snippets/qml/events.qml parent begin
+\snippet doc/src/snippets/qml/events.qml signal declaration
+\snippet doc/src/snippets/qml/events.qml parent end
If the signal has no parameters, the "\c{()}" brackets are optional. If
parameters are used, the parameter types must be declared, as for the \c string
@@ -69,17 +69,17 @@ and \c variant arguments of the \c perform signal.
Adding a signal to an item automatically adds a \i{signal handler} as well. The
signal hander is named \c on<SignalName>, with the first letter of the signal in
uppercase. The previous signals have the following signal handlers:
-\snippet doc/src/snippets/declarative/events.qml signal handler declaration
+\snippet doc/src/snippets/qml/events.qml signal handler declaration
Further, each QML properties have a \c{<property_name>Changed} signal and its
corresponding \c{on<property_name>Changed} signal handler. As a result, property
changes may notify other components for any changes.
-\snippet doc/src/snippets/declarative/events.qml automatic signals
+\snippet doc/src/snippets/qml/events.qml automatic signals
To emit a signal, invoke it as a method. The signal handler binding is similar
to a property binding and it is invoked when the signal is emitted. Use the
defined argument names to access the respective arguments.
-\snippet doc/src/snippets/declarative/events.qml signal emit
+\snippet doc/src/snippets/qml/events.qml signal emit
Note that the \c Component.onCompleted is an
\l{attached-signalhandlers}{attached signal handler}; it is invoked when the
\l Component initialization is complete.
@@ -93,7 +93,7 @@ automatically invoked whenever the signal is emitted. This mechanism enables a
signal to be received by a method instead of a
\l {Signal Handlers}{signal handler}.
-\snippet doc/src/snippets/declarative/events.qml connect method
+\snippet doc/src/snippets/qml/events.qml connect method
The \c {connect()} method is appropriate when connecting a JavaScript method to
a signal.
@@ -104,7 +104,7 @@ signals.
By connecting signals to other signals, the \c connect() method can form different
signal chains.
-\snippet doc/src/snippets/declarative/events.qml forward signal
+\snippet doc/src/snippets/qml/events.qml forward signal
Whenever the \l MouseArea \c clicked signal is emitted, the \c send
diff --git a/doc/src/qml/qmlintro.qdoc b/doc/src/qml/qmlintro.qdoc
index 03ee94d6d1..3290a27bc3 100644
--- a/doc/src/qml/qmlintro.qdoc
+++ b/doc/src/qml/qmlintro.qdoc
@@ -1197,7 +1197,7 @@ arrange a set of Rectangle items. The Repeater item creates a series of 24
rectangles for the Grid item to position in a 5 by 5 arrangement.
\clearfloat
-\snippet doc/src/snippets/declarative/repeaters/repeater-grid-index.qml document
+\snippet doc/src/snippets/qml/repeaters/repeater-grid-index.qml document
The number of items created by a Repeater is held by its \l{Repeater::}{count}
property. It is not possible to set this property to determine the number of
diff --git a/doc/src/qml/qmlplugins.qdoc b/doc/src/qml/qmlplugins.qdoc
index 9b6fe29c1e..e41bba2906 100644
--- a/doc/src/qml/qmlplugins.qdoc
+++ b/doc/src/qml/qmlplugins.qdoc
@@ -36,16 +36,16 @@
C++ code as plugins. Plugins are imported and labeled as modules and
its content are available as components.
- QDeclarativeExtensionPlugin is a plugin interface that makes it possible to
+ QQmlExtensionPlugin is a plugin interface that makes it possible to
create QML extensions that can be loaded dynamically into QML applications.
These extensions allow custom QML types to be made available to the
QML engine.
To write a QML extension plugin:
\list 1
- \o Subclass QDeclarativeExtensionPlugin
- \o Implement QDeclarativeExtensionPlugin's
- \l{QDeclarativeExtensionPlugin::}{registerTypes()} method
+ \o Subclass QQmlExtensionPlugin
+ \o Implement QQmlExtensionPlugin's
+ \l{QQmlExtensionPlugin::}{registerTypes()} method
\o Register types with qmlRegisterType()
\o Export the class using the Q_EXPORT_PLUGIN2() macro
\o Write a project file for the plugin
@@ -67,8 +67,8 @@
\dots
A plugin class, \c QExampleQMLPlugin, is a subclass of
- \l QDeclarativeExtensionPlugin and it implements the
- \l{QDeclarativeExtensionPlugin::}{registerTypes()} method.
+ \l QQmlExtensionPlugin and it implements the
+ \l{QQmlExtensionPlugin::}{registerTypes()} method.
In the registerTypes() method, the plugin class can
\l{register-c++-type}{register} the \c TimeModel class to the declarative
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}.
diff --git a/doc/src/qml/qmlsyntax.qdoc b/doc/src/qml/qmlsyntax.qdoc
index b2b7fc89bd..1cd6ad7f46 100644
--- a/doc/src/qml/qmlsyntax.qdoc
+++ b/doc/src/qml/qmlsyntax.qdoc
@@ -133,7 +133,7 @@ Commenting in QML is similar to JavaScript.
\o Multiline comments start with /* and finish with *\/
\endlist
-\snippet doc/src/snippets/declarative/comments.qml 0
+\snippet doc/src/snippets/qml/comments.qml 0
Comments are ignored by the engine. They are useful for explaining what you
are doing; for referring back to at a later date, or for others reading
diff --git a/doc/src/qml/qmltypes.qdoc b/doc/src/qml/qmltypes.qdoc
index 964ff98a15..9555e54f7e 100644
--- a/doc/src/qml/qmltypes.qdoc
+++ b/doc/src/qml/qmltypes.qdoc
@@ -350,7 +350,7 @@ Q_PROPERTY(int size READ size CONSTANT)
Properties that are lists of objects or Qt interfaces are also declared with
the Q_PROPERTY() macro. However, list properties must have the type
- \l{QDeclarativeListProperty}{QDeclarativeListProperty<T>}.
+ \l{QQmlListProperty}{QQmlListProperty<T>}.
\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 2
@@ -361,7 +361,7 @@ Q_PROPERTY(int size READ size CONSTANT)
\l {Extending QML - Object and List Property Types Example} shows the
complete code used to create the \c BirthdayParty type. For more
- information, visit \l{QDeclarativeListProperty}{QDeclarativeListProperty<T>}
+ information, visit \l{QQmlListProperty}{QQmlListProperty<T>}
for creating list properties.
\section2 Sequence Types
@@ -756,8 +756,8 @@ itself, the QML engine sets up an association between the value source and
the property.
Property value sources are special types that derive from the
-QDeclarativePropertyValueSource base class. This base class contains a single method,
-QDeclarativePropertyValueSource::setTarget(), that the QML engine invokes when
+QQmlPropertyValueSource base class. This base class contains a single method,
+QQmlPropertyValueSource::setTarget(), that the QML engine invokes when
associating the property value source with a property. The relevant part of
the \c HappyBirthdaySong type declaration looks like this:
@@ -771,7 +771,7 @@ contain properties, signals and methods just like other types.
When a property value source object is assigned to a property, QML first tries
to assign it normally, as though it were a regular QML type. Only if this
-assignment fails does the engine call the \l {QDeclarativePropertyValueSource::}{setTarget()} method. This allows
+assignment fails does the engine call the \l {QQmlPropertyValueSource::}{setTarget()} method. This allows
the type to also be used in contexts other than just as a value source.
\l {Extending QML - Property Value Source Example} shows the complete code used
diff --git a/doc/src/qml/qmlviewer.qdoc b/doc/src/qml/qmlviewer.qdoc
index 6439e95f4e..9006a053fc 100644
--- a/doc/src/qml/qmlviewer.qdoc
+++ b/doc/src/qml/qmlviewer.qdoc
@@ -160,7 +160,7 @@ QtObject { property int time: 54321 }
\endqml
To replace this with real data, you can simply bind the real data object to
-the root context in C++ using QDeclarativeContext::setContextProperty(). This
+the root context in C++ using QQmlContext::setContextProperty(). This
is detailed in \l {Using QML Bindings in C++ Applications}.
\section1 Using the \c runtime object
diff --git a/doc/src/qml/qtbinding.qdoc b/doc/src/qml/qtbinding.qdoc
index 10581857dc..7410836e9c 100644
--- a/doc/src/qml/qtbinding.qdoc
+++ b/doc/src/qml/qtbinding.qdoc
@@ -43,12 +43,12 @@ You may want to mix QML and C++ for a number of reasons. For example:
\o To use functionality defined in a C++ source (for example, when using a C++ Qt-based data model, or
calling functions in a third-party C++ library)
\o To access functionality in the Qt Declarative module (for example, to dynamically generate
-images using QDeclarativeImageProvider)
+images using QQmlImageProvider)
\o To write your own QML elements (whether for your applications, or for distribution to others)
\endlist
To use the Qt Declarative module, you must include and link to the module appropriately, as shown on
-the \l {QtDeclarative}{module index page}. The \l {Qt Declarative UI Runtime} documentation
+the \l {QtQml}{module index page}. The \l {Qt Declarative UI Runtime} documentation
shows how to build a basic C++ application that uses this module.
@@ -59,32 +59,32 @@ embedding QML into C++ applications. There are several core classes in the Qt De
that provide the essential capabilities for doing this. These are:
\list
-\o QDeclarativeEngine: A QML engine provides the environment for executing QML code. Every
+\o QQmlEngine: A QML engine provides the environment for executing QML code. Every
application requires at least one engine instance.
-\o QDeclarativeComponent: A component encapsulates a \l{QML Documents}{QML document}.
-\o QDeclarativeContext: A context allows an application to expose data to the QML components
+\o QQmlComponent: A component encapsulates a \l{QML Documents}{QML document}.
+\o QQmlContext: A context allows an application to expose data to the QML components
created by an engine.
\endlist
-A QDeclarativeEngine allows the configuration of global settings that apply to all of its QML
+A QQmlEngine allows the configuration of global settings that apply to all of its QML
component instances: for example, the QNetworkAccessManager to be used for network communications,
and the file path to be used for persistent storage.
-QDeclarativeComponent is used to load QML documents. Each QDeclarativeComponent instance represents
+QQmlComponent is used to load QML documents. Each QQmlComponent instance represents
a single document. A component can be created from the URL or file path of a QML document, or the raw
QML code of the document. Component instances are instatiated through the
-QDeclarativeComponent::create() method, like this:
+QQmlComponent::create() method, like this:
\code
-QDeclarativeEngine engine;
-QDeclarativeComponent component(&engine, QUrl::fromLocalFile("MyRectangle.qml"));
+QQmlEngine engine;
+QQmlComponent component(&engine, QUrl::fromLocalFile("MyRectangle.qml"));
QObject *rectangleInstance = component.create();
// ...
delete rectangleInstance;
\endcode
-QML documents can also be loaded using QDeclarativeView. This class provides a convenient
+QML documents can also be loaded using QQuickView. This class provides a convenient
QWidget-based view for embedding QML components into QGraphicsView-based applications. (For other
methods of integrating QML into QWidget-based applications, see \l {Integrating QML Code with existing Qt
UI code}.)
@@ -108,41 +108,41 @@ these methods throughout your application as appropriate.
\section2 Loading QML Components from C++
-A QML document can be loaded with QDeclarativeComponent or QDeclarativeView. QDeclarativeComponent
-loads a QML component as a C++ object; QDeclarativeView also does this,
+A QML document can be loaded with QQmlComponent or QQuickView. QQmlComponent
+loads a QML component as a C++ object; QQuickView also does this,
but additionally loads the QML component directly into a QGraphicsView. It is convenient for loading
a displayable QML component into a QWidget-based application.
For example, suppose there is a \c MyItem.qml file that looks like this:
-\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml start
-\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml end
+\snippet doc/src/snippets/qml/qtbinding/loading/MyItem.qml start
+\snippet doc/src/snippets/qml/qtbinding/loading/MyItem.qml end
-This QML document can be loaded with QDeclarativeComponent or QDeclarativeView with the following
-C++ code. Using a QDeclarativeComponent requires calling QDeclarativeComponent::create() to create
-a new instance of the component, while a QDeclarativeView automatically creates an instance of the
-component, which is accessible via QDeclarativeView::rootObject():
+This QML document can be loaded with QQmlComponent or QQuickView with the following
+C++ code. Using a QQmlComponent requires calling QQmlComponent::create() to create
+a new instance of the component, while a QQuickView automatically creates an instance of the
+component, which is accessible via QQuickView::rootObject():
\table
\row
\o
-\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp QDeclarativeComponent-a
+\snippet doc/src/snippets/qml/qtbinding/loading/main.cpp QQmlComponent-a
\dots 0
-\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp QDeclarativeComponent-b
+\snippet doc/src/snippets/qml/qtbinding/loading/main.cpp QQmlComponent-b
\o
-\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp QDeclarativeView
+\snippet doc/src/snippets/qml/qtbinding/loading/main.cpp QQuickView
\endtable
This \c object is the instance of the \c MyItem.qml component that has been created. You can now
-modify the item's properties using QObject::setProperty() or QDeclarativeProperty:
+modify the item's properties using QObject::setProperty() or QQmlProperty:
-\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp properties
+\snippet doc/src/snippets/qml/qtbinding/loading/main.cpp properties
Alternatively, you can cast the object to its actual type and call functions with compile-time
safety. In this case the base object of \c MyItem.qml is an \l Item, which is defined by the
-QDeclarativeItem class:
+QQuickItem class:
-\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp cast
+\snippet doc/src/snippets/qml/qtbinding/loading/main.cpp cast
You can also connect to any signals or call functions defined in the component using
QMetaObject::invokeMethod() and QObject::connect(). See \l {Exchanging data between QML and C++}
@@ -154,14 +154,14 @@ QML components are essentially object trees with children that have siblings and
Child objects of QML components can be located using the QObject::objectName property with
QObject::findChild(). For example, if the root item in \c MyItem.qml had a child \l Rectangle item:
-\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml start
+\snippet doc/src/snippets/qml/qtbinding/loading/MyItem.qml start
\codeline
-\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml child
-\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml end
+\snippet doc/src/snippets/qml/qtbinding/loading/MyItem.qml child
+\snippet doc/src/snippets/qml/qtbinding/loading/MyItem.qml end
The child could be located like this:
-\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp findChild
+\snippet doc/src/snippets/qml/qtbinding/loading/main.cpp findChild
If \c objectName is used inside a delegate of a ListView, \l Repeater or some other
element that creates multiple instances of its delegates, there will be multiple children with
@@ -181,18 +181,18 @@ the QML user interface implementation and the composition of the QML object tree
\section2 Embedding C++ Objects into QML Components
When loading a QML scene into a C++ application, it can be useful to directly embed C++ data into
-the QML object. QDeclarativeContext enables this by exposing data to the context of a QML
+the QML object. QQmlContext enables this by exposing data to the context of a QML
component, allowing data to be injected from C++ into QML.
For example, here is a QML item that refers to a \c currentDateTime value that does not exist in
the current scope:
-\snippet doc/src/snippets/declarative/qtbinding/context/MyItem.qml 0
+\snippet doc/src/snippets/qml/qtbinding/context/MyItem.qml 0
This \c currentDateTime value can be set directly by the C++ application that loads the QML
-component, using QDeclarativeContext::setContextProperty():
+component, using QQmlContext::setContextProperty():
-\snippet doc/src/snippets/declarative/qtbinding/context/main.cpp 0
+\snippet doc/src/snippets/qml/qtbinding/context/main.cpp 0
Context properties can hold either QVariant or QObject* values. This means custom C++ objects can
also be injected using this approach, and these objects can be modified and read directly in QML.
@@ -202,11 +202,11 @@ invokes a method on the object instance:
\table
\row
\o
-\snippet doc/src/snippets/declarative/qtbinding/context-advanced/applicationdata.h 0
+\snippet doc/src/snippets/qml/qtbinding/context-advanced/applicationdata.h 0
\codeline
-\snippet doc/src/snippets/declarative/qtbinding/context-advanced/main.cpp 0
+\snippet doc/src/snippets/qml/qtbinding/context-advanced/main.cpp 0
\o
-\snippet doc/src/snippets/declarative/qtbinding/context-advanced/MyItem.qml 0
+\snippet doc/src/snippets/qml/qtbinding/context-advanced/MyItem.qml 0
\endtable
(Note that date/time values returned from C++ to QML can be formatted through
@@ -217,7 +217,7 @@ If the QML item needs to receive signals from the context property, it can conne
dataChanged(), this signal can be connected to using an \c onDataChanged handler within
a \l Connections object:
-\snippet doc/src/snippets/declarative/qtbinding/context-advanced/connections.qml 0
+\snippet doc/src/snippets/qml/qtbinding/context-advanced/connections.qml 0
Context properties can be useful for using C++ based data models in a QML view. See the
\l {declarative/modelviews/stringlistmodel}{String ListModel},
@@ -226,7 +226,7 @@ Context properties can be useful for using C++ based data models in a QML view.
respective examples on using QStringListModel, QObjectList-based models and QAbstractItemModel
in QML views.
-Also see the QDeclarativeContext documentation for more information.
+Also see the QQmlContext documentation for more information.
\section2 Defining New QML Elements
@@ -236,30 +236,30 @@ defined by C++ classes; in fact, many of the core \l {QML Elements} are implemen
C++ classes. When you create a QML object using one of these elements, you are simply creating an
instance of a QObject-based C++ class and setting its properties.
-To create a visual item that fits in with the Qt Quick elements, base your class off \l QDeclarativeItem instead of QObject directly.
-You can then implement your own painting and functionality like any other QGraphicsObject. Note that QGraphicsItem::ItemHasNoContents is set by default on QDeclarativeItem because
+To create a visual item that fits in with the Qt Quick elements, base your class off \l QQuickItem instead of QObject directly.
+You can then implement your own painting and functionality like any other QGraphicsObject. Note that QGraphicsItem::ItemHasNoContents is set by default on QQuickItem because
it does not paint anything; you will need to clear this if your item is supposed to paint anything (as opposed to being solely for input handling or logical grouping).
For example, here is an \c ImageViewer class with an \c image URL property:
-\snippet doc/src/snippets/declarative/qtbinding/newelements/imageviewer.h 0
+\snippet doc/src/snippets/qml/qtbinding/newelements/imageviewer.h 0
-Aside from the fact that it inherits QDeclarativeItem, this is an ordinary class that could
+Aside from the fact that it inherits QQuickItem, this is an ordinary class that could
exist outside of QML. However, once it is registered with the QML engine using qmlRegisterType():
-\snippet doc/src/snippets/declarative/qtbinding/newelements/main.cpp register
+\snippet doc/src/snippets/qml/qtbinding/newelements/main.cpp register
-Then, any QML code loaded by your C++ application or \l{QDeclarativeExtensionPlugin}{plugin} can create and manipulate
+Then, any QML code loaded by your C++ application or \l{QQmlExtensionPlugin}{plugin} can create and manipulate
\c ImageViewer objects:
-\snippet doc/src/snippets/declarative/qtbinding/newelements/standalone.qml 0
+\snippet doc/src/snippets/qml/qtbinding/newelements/standalone.qml 0
-It is advised that you avoid using QGraphicsItem functionality beyond the properties documented in QDeclarativeItem.
+It is advised that you avoid using QGraphicsItem functionality beyond the properties documented in QQuickItem.
This is because the GraphicsView backend is intended to be an implementation detail for QML, so the QtQuick items can be moved to faster backends as they become available with no change from a QML perspective.
-To minimize any porting requirements for custom visual items, try to stick to the documented properties in QDeclarativeItem where possible. Properties QDeclarativeItem inherits but doesn't document are classed as implementation details; they are not officially supported and may disappear between releases.
+To minimize any porting requirements for custom visual items, try to stick to the documented properties in QQuickItem where possible. Properties QQuickItem inherits but doesn't document are classed as implementation details; they are not officially supported and may disappear between releases.
-Note that custom C++ types do not have to inherit from QDeclarativeItem; this is only necessary if it is
+Note that custom C++ types do not have to inherit from QQuickItem; this is only necessary if it is
a displayable item. If the item is not displayable, it can simply inherit from QObject.
For more information on defining new QML elements, see the \l {Tutorial: Writing QML extensions with C++}
@@ -286,8 +286,8 @@ QMetaObject::invokeMethod(). Here is a C++ application that uses this to call a
\table
\row
-\o \snippet doc/src/snippets/declarative/qtbinding/functions-qml/MyItem.qml 0
-\o \snippet doc/src/snippets/declarative/qtbinding/functions-qml/main.cpp 0
+\o \snippet doc/src/snippets/qml/qtbinding/functions-qml/MyItem.qml 0
+\o \snippet doc/src/snippets/qml/qtbinding/functions-qml/main.cpp 0
\endtable
Notice the Q_RETURN_ARG() and Q_ARG() arguments for QMetaObject::invokeMethod() must be specified as
@@ -295,16 +295,16 @@ QVariant types, as this is the generic data type used for QML functions and retu
To call a C++ function from QML, the function must be either a Qt slot, or a function marked with
the Q_INVOKABLE macro, to be available to QML. In the following example, the QML code invokes
-methods on the \c myObject object, which has been set using QDeclarativeContext::setContextProperty():
+methods on the \c myObject object, which has been set using QQmlContext::setContextProperty():
\table
\row
\o
-\snippet doc/src/snippets/declarative/qtbinding/functions-cpp/MyItem.qml 0
+\snippet doc/src/snippets/qml/qtbinding/functions-cpp/MyItem.qml 0
\o
-\snippet doc/src/snippets/declarative/qtbinding/functions-cpp/myclass.h 0
+\snippet doc/src/snippets/qml/qtbinding/functions-cpp/myclass.h 0
\codeline
-\snippet doc/src/snippets/declarative/qtbinding/functions-cpp/main.cpp 0
+\snippet doc/src/snippets/qml/qtbinding/functions-cpp/main.cpp 0
\endtable
QML supports the calling of overloaded C++ functions. If there are multiple C++ functions with the
@@ -325,11 +325,11 @@ is emitted:
\table
\row
\o
-\snippet doc/src/snippets/declarative/qtbinding/signals-qml/MyItem.qml 0
+\snippet doc/src/snippets/qml/qtbinding/signals-qml/MyItem.qml 0
\o
-\snippet doc/src/snippets/declarative/qtbinding/signals-qml/myclass.h 0
+\snippet doc/src/snippets/qml/qtbinding/signals-qml/myclass.h 0
\codeline
-\snippet doc/src/snippets/declarative/qtbinding/signals-qml/main.cpp 0
+\snippet doc/src/snippets/qml/qtbinding/signals-qml/main.cpp 0
\endtable
To connect to Qt C++ signals from within QML, use a signal handler with the \c on<SignalName> syntax.
@@ -342,12 +342,12 @@ C++ object are connected to through \c onImagedChanged and \c onLoadingError sig
\row
\o
-\snippet doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h start
+\snippet doc/src/snippets/qml/qtbinding/signals-cpp/imageviewer.h start
\dots 4
-\snippet doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h end
+\snippet doc/src/snippets/qml/qtbinding/signals-cpp/imageviewer.h end
\o
-\snippet doc/src/snippets/declarative/qtbinding/signals-cpp/standalone.qml 0
+\snippet doc/src/snippets/qml/qtbinding/signals-cpp/standalone.qml 0
\endtable
(Note that if a signal has been declared as the NOTIFY signal for a property, QML allows it to be
@@ -357,13 +357,13 @@ received with an \c on<Property>Changed handler even if the signal's name does n
If, however, the object with the signal is not created from within the QML code, and the QML item only has a
reference to the created object - for example, if the object was set using
-QDeclarativeContext::setContextProperty() - then the \l Connections element can be used
+QQmlContext::setContextProperty() - then the \l Connections element can be used
instead to create the signal handler:
\table
\row
-\o \snippet doc/src/snippets/declarative/qtbinding/signals-cpp/main.cpp connections
-\o \snippet doc/src/snippets/declarative/qtbinding/signals-cpp/MyItem.qml 0
+\o \snippet doc/src/snippets/qml/qtbinding/signals-cpp/main.cpp connections
+\o \snippet doc/src/snippets/qml/qtbinding/signals-cpp/MyItem.qml 0
\endtable
C++ signals can use enum values as parameters provided that the enum is declared in the
@@ -376,14 +376,14 @@ See \l {Using enumerations of a custom type} below for details.
Any properties declared in a QML object are automatically accessible from C++. Given a QML item
like this:
-\snippet doc/src/snippets/declarative/qtbinding/properties-qml/MyItem.qml 0
+\snippet doc/src/snippets/qml/qtbinding/properties-qml/MyItem.qml 0
-The value of the \c someNumber property can be set and read using QDeclarativeProperty, or
+The value of the \c someNumber property can be set and read using QQmlProperty, or
QObject::setProperty() and QObject::property():
-\snippet doc/src/snippets/declarative/qtbinding/properties-qml/main.cpp 0
+\snippet doc/src/snippets/qml/qtbinding/properties-qml/main.cpp 0
-You should always use QObject::setProperty(), QDeclarativeProperty or QMetaProperty::write() to
+You should always use QObject::setProperty(), QQmlProperty or QMetaProperty::write() to
change a QML property value, to ensure the QML engine is made aware of the property change. For example,
say you have a custom element \c PushButton with a \c buttonText property that internally reflects
the value of a \c m_buttonText member variable. Modifying the member variable directly like this is
@@ -391,7 +391,7 @@ not a good idea:
\badcode
// BAD!
-QDeclarativeComponent component(engine, "MyButton.qml");
+QQmlComponent component(engine, "MyButton.qml");
PushButton *button = qobject_cast<PushButton*>(component.create());
button->m_buttonText = "Click me";
\endcode
@@ -410,8 +410,8 @@ property. This property can be written to and read from QML:
\table
\row
-\o \snippet doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h 0
-\o \snippet doc/src/snippets/declarative/qtbinding/properties-cpp/MyItem.qml 0
+\o \snippet doc/src/snippets/qml/qtbinding/properties-cpp/applicationdata.h 0
+\o \snippet doc/src/snippets/qml/qtbinding/properties-cpp/MyItem.qml 0
\endtable
Notice the \c backgroundColorChanged signal is declared as the NOTIFY signal for the
@@ -468,8 +468,8 @@ converted to JavaScript array and object values, repectively:
\o String format
\o Example
\row
-\o \snippet doc/src/snippets/declarative/qtbinding/variantlistmap/MyItem.qml 0
-\o \snippet doc/src/snippets/declarative/qtbinding/variantlistmap/main.cpp 0
+\o \snippet doc/src/snippets/qml/qtbinding/variantlistmap/MyItem.qml 0
+\o \snippet doc/src/snippets/qml/qtbinding/variantlistmap/main.cpp 0
\endtable
This produces output like:
@@ -492,13 +492,13 @@ side, and is automatically converted to a QVariantList or QVariantMap when it is
To use an enumeration from a custom C++ component, the enumeration must be declared with Q_ENUMS() to
register it with Qt's meta object system. For example, the following C++ type has a \c Status enum:
-\snippet doc/src/snippets/declarative/qtbinding/enums/imageviewer.h start
-\snippet doc/src/snippets/declarative/qtbinding/enums/imageviewer.h end
+\snippet doc/src/snippets/qml/qtbinding/enums/imageviewer.h start
+\snippet doc/src/snippets/qml/qtbinding/enums/imageviewer.h end
Providing the \c ImageViewer class has been registered using qmlRegisterType(), its \c Status enum can
now be used from QML:
-\snippet doc/src/snippets/declarative/qtbinding/enums/standalone.qml 0
+\snippet doc/src/snippets/qml/qtbinding/enums/standalone.qml 0
The C++ type must be registered with QML to use its enums. If your C++ type is not instantiable, it
can be registered using qmlRegisterUncreatableType(). To be accessible from QML, the names of enum values
@@ -525,7 +525,7 @@ function, the enum type must be registered using qRegisterMetaType().
For QML signals, enum values may be used as signal parameters using the \c int type:
-\snippet doc/src/snippets/declarative/qtbinding/enums/standalone.qml 1
+\snippet doc/src/snippets/qml/qtbinding/enums/standalone.qml 1
\section2 Automatic Type Conversion from Strings
@@ -594,11 +594,11 @@ a QColor-type property or to call a C++ function that requires a QColor paramete
\section1 Writing QML plugins
-The Qt Declarative module includes the QDeclarativeExtensionPlugin class, which is an abstract
+The Qt Declarative module includes the QQmlExtensionPlugin class, which is an abstract
class for writing QML plugins. This allows QML extension types to be dynamically loaded into
QML applications.
-See the QDeclarativeExtensionPlugin documentation and \l {How to Create Qt Plugins} for more
+See the QQmlExtensionPlugin documentation and \l {How to Create Qt Plugins} for more
details.
@@ -643,22 +643,22 @@ project
The \c main.qml and \c background.png files will be packaged as resource files. This is
done in the \c example.qrc resource collection file:
-\quotefile doc/src/snippets/declarative/qtbinding/resources/example.qrc
+\quotefile doc/src/snippets/qml/qtbinding/resources/example.qrc
Since \c background.png is a resource file, \c main.qml can refer to it using the relative
path specified in \c example.qrc:
-\snippet doc/src/snippets/declarative/qtbinding/resources/main.qml 0
+\snippet doc/src/snippets/qml/qtbinding/resources/main.qml 0
To allow QML to locate resource files correctly, the \c main.cpp loads the main QML
file, \c main.qml, as a resource file using the \c qrc scheme:
-\snippet doc/src/snippets/declarative/qtbinding/resources/main.cpp 0
+\snippet doc/src/snippets/qml/qtbinding/resources/main.cpp 0
Finally \c project.pro uses the RESOURCES variable to indicate that \c example.qrc should
be used to build the application resources:
-\quotefile doc/src/snippets/declarative/qtbinding/resources/resources.pro
+\quotefile doc/src/snippets/qml/qtbinding/resources/resources.pro
See \l {The Qt Resource System} for more information.
diff --git a/doc/src/qml/qtdeclarative.qdoc b/doc/src/qml/qtdeclarative.qdoc
index c4b59fb07b..9d14f7fc57 100644
--- a/doc/src/qml/qtdeclarative.qdoc
+++ b/doc/src/qml/qtdeclarative.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \module QtDeclarative
+ \module QtQml
\title Qt Declarative Module
\ingroup modules
@@ -37,7 +37,7 @@
following directive:
\code
- #include <QtDeclarative>
+ #include <QtQml>
\endcode
To link against the module, add this line to your \l qmake \c
@@ -54,16 +54,16 @@
/*!
\macro QML_DECLARE_TYPE()
- \relates QDeclarativeEngine
+ \relates QQmlEngine
- Equivalent to \c Q_DECLARE_METATYPE(TYPE *) and \c Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>)
+ Equivalent to \c Q_DECLARE_METATYPE(TYPE *) and \c Q_DECLARE_METATYPE(QQmlListProperty<TYPE>)
- #include <QtDeclarative> to use this macro.
+ #include <QtQml> to use this macro.
*/
/*!
\macro QML_DECLARE_TYPEINFO(Type,Flags)
- \relates QDeclarativeEngine
+ \relates QQmlEngine
Declares additional properties of the given \a Type as described by the
specified \a Flags.
@@ -71,13 +71,13 @@
Current the only supported type info is \c QML_HAS_ATTACHED_PROPERTIES which
declares that the \a Type supports \l {Attached Properties}.
- #include <QtDeclarative> to use this macro.
+ #include <QtQml> to use this macro.
*/
/*!
\fn int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
- \relates QDeclarativeEngine
+ \relates QQmlEngine
This template function registers the C++ type in the QML system with
the name \a qmlName, in the library imported from \a uri having the
@@ -105,7 +105,7 @@
"com.mycompany.qmlcomponents":
\code
- #include <QtDeclarative>
+ #include <QtQml>
...
@@ -131,7 +131,7 @@
/*!
\fn int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor)
- \relates QDeclarativeEngine
+ \relates QQmlEngine
This template function registers the specified revision of a C++ type in the QML system with
the library imported from \a uri having the version number composed
@@ -150,7 +150,7 @@
/*!
\fn int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message)
- \relates QDeclarativeEngine
+ \relates QQmlEngine
This template function registers the C++ type in the QML system with
the name \a qmlName, in the library imported from \a uri having the
@@ -163,14 +163,14 @@
Returns the QML type id.
- #include <QtDeclarative> to use this function.
+ #include <QtQml> to use this function.
\sa qmlRegisterTypeNotAvailable()
*/
/*!
\fn int qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message)
- \relates QDeclarativeEngine
+ \relates QQmlEngine
This function registers a type in the QML system with the name \a qmlName, in the library imported from \a uri having the
version number composed from \a versionMajor and \a versionMinor, but any attempt to instantiate the type
@@ -200,40 +200,40 @@
Without this, a generic "Game is not a type" message would be given.
- #include <QtDeclarative> to use this function.
+ #include <QtQml> to use this function.
\sa qmlRegisterUncreatableType()
*/
/*!
\fn int qmlRegisterType()
- \relates QDeclarativeEngine
+ \relates QQmlEngine
\overload
This template function registers the C++ type in the QML
system. Instances of this type cannot be created from the QML
system.
- #include <QtDeclarative> to use this function.
+ #include <QtQml> to use this function.
Returns the QML type id.
*/
/*!
\fn int qmlRegisterInterface(const char *typeName)
- \relates QDeclarativeEngine
+ \relates QQmlEngine
This template function registers the C++ type in the QML system
under the name \a typeName.
- #include <QtDeclarative> to use this function.
+ #include <QtQml> to use this function.
Returns the QML type id.
*/
/*!
- \fn int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor, QJSValue (*callback)(QDeclarativeEngine *, QJSEngine *))
- \relates QDeclarativeEngine
+ \fn int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor, QJSValue (*callback)(QQmlEngine *, QJSEngine *))
+ \relates QQmlEngine
This function may be used to register a module API provider \a callback in a particular \a uri
with a version specified in \a versionMajor and \a versionMinor.
@@ -250,7 +250,7 @@
Usage:
\code
// first, define the module API provider function (callback).
- static QJSValue *example_qjsvalue_module_api_provider(QDeclarativeEngine *engine, QJSEngine *scriptEngine)
+ static QJSValue *example_qjsvalue_module_api_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
@@ -278,8 +278,8 @@
*/
/*!
- \fn int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor, QObject *(*callback)(QDeclarativeEngine *, QJSEngine *))
- \relates QDeclarativeEngine
+ \fn int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor, QObject *(*callback)(QQmlEngine *, QJSEngine *))
+ \relates QQmlEngine
This function may be used to register a module API provider \a callback in a particular \a uri
with a version specified in \a versionMajor and \a versionMinor.
@@ -325,7 +325,7 @@
};
// second, define the module API provider function (callback).
- static QObject *example_qobject_module_api_provider(QDeclarativeEngine *engine, QJSEngine *scriptEngine)
+ static QObject *example_qobject_module_api_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
diff --git a/doc/src/qml/qtprogrammers.qdoc b/doc/src/qml/qtprogrammers.qdoc
index 215f71859c..9338a2c29f 100644
--- a/doc/src/qml/qtprogrammers.qdoc
+++ b/doc/src/qml/qtprogrammers.qdoc
@@ -44,7 +44,7 @@ QML provides direct access to the following concepts from Qt:
\o QAction - the \l {QML Basic Types}{action} type
\o QObject signals and slots - available as functions to call in JavaScript
\o QObject properties - available as variables in JavaScript
- \o QWidget - QDeclarativeView is a QML-displaying widget
+ \o QWidget - QQuickView is a QML-displaying widget
\o Qt models - used directly in data binding (QAbstractItemModel)
\endlist
@@ -71,12 +71,12 @@ QML Items also serve these purposes. Each is considered separately below.
\section2 Simple Widgets
-The most important rule to remember while implementing a new QDeclarativeItem in C++
+The most important rule to remember while implementing a new QQuickItem in C++
is that it should not contain any look and feel policies; leave that to the QML
usage of the item.
As an example, imagine you wanted a reusable Button item. If you therefore decided
-to write a QDeclarativeItem subclass to implement a button, just as QToolButton
+to write a QQuickItem subclass to implement a button, just as QToolButton
subclasses QWidget for this purpose, following the rule above, your
\c QDeclarativeButton would not have any appearance; just the notions of enabled,
triggering, etc.
@@ -92,7 +92,7 @@ between states, and exactly how it responds to mouse, key, or touch input, shoul
all be left for definition in QML.
It is illustrative to note that QDeclarativeTextEdit is built upon QTextControl,
-QDeclarativeWebView is built upon QWebPage, and ListView uses QAbstractItemModel,
+QQuickWebView is built upon QWebPage, and ListView uses QAbstractItemModel,
just as QTextEdit, QWebView, and QListView are built upon those same UI-agnostic
components.
@@ -167,7 +167,7 @@ QGraphicsWidgets are usually designed to be laid out with QGraphicsLayouts. QML
not use QGraphicsLayouts, as the Qt layouts do not mix well with animated and fluid
UIs, so the geometry interface is one of the main differences. When writing QML
elements, you allow the designers to place their bounding rectangle using absolute
-geometry, bindings or anchors (all set up for you when you inherit QDeclarativeItem)
+geometry, bindings or anchors (all set up for you when you inherit QQuickItem)
and you do not use layouts or size hints. If size hints are appropriate, then place
them in the QML documentation so that the designers know how to use the item best,
but still have complete control over the look and feel.
@@ -182,14 +182,14 @@ look and feel (which involves the UI logic) can be written in QML.
Both differences are caused by the different method of interaction. QGraphicsWidget
is a QGraphicsObject subclass which makes fluid UI development from C++ easier, and
-QDeclarativeItem is a QGraphicsObject subclass which makes fluid UI development
+QQuickItem is a QGraphicsObject subclass which makes fluid UI development
from QML easier. The difference, therefore, is primarily one of the interface
exposed, and the design of the items that come with it; the declarative primitives
for QML and nothing for QGraphicsWidget, because you need to write your own UI
logic into the subclass.
If you wish to use both QML and C++ to write the UI, for example to ease the
-transition period, it is recommended to use QDeclarativeItem subclasses, although
+transition period, it is recommended to use QQuickItem subclasses, although
you can use QGraphicsWidgets as well. To allow for easier use from C++, make the
root item of each C++ component a \l LayoutItem, and load individual "widgets" of
QML (possibly comprised of multiple files, and containing a self-contained bundle