summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2009-10-14 04:35:35 (GMT)
committerBea Lam <bea.lam@nokia.com>2009-10-14 04:35:35 (GMT)
commitb57d6c247215aa5b1d78cb1ca72b794012113d00 (patch)
treed82ffdd097eb5a754ad2b62e9ea627071fb0f588 /doc/src
parentf303d6e3a44de30b9b1dc869c9a54c60cb383f8a (diff)
parent513cc4be0bec4a5fb303062ecbecf87708dc0e9b (diff)
downloadQt-b57d6c247215aa5b1d78cb1ca72b794012113d00.zip
Qt-b57d6c247215aa5b1d78cb1ca72b794012113d00.tar.gz
Qt-b57d6c247215aa5b1d78cb1ca72b794012113d00.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/declarative/binding.qdoc31
-rw-r--r--doc/src/declarative/cppitem.qdoc170
-rw-r--r--doc/src/declarative/ecmascriptblocks.qdoc213
-rw-r--r--doc/src/declarative/elements.qdoc9
-rw-r--r--doc/src/declarative/examples.qdoc52
-rw-r--r--doc/src/declarative/extending.qdoc68
-rw-r--r--doc/src/declarative/network.qdoc126
-rw-r--r--doc/src/declarative/pics/anatomy-component.pngbin0 -> 16117 bytes
-rw-r--r--doc/src/declarative/pics/dial-example.gifbin0 -> 566465 bytes
-rw-r--r--doc/src/declarative/pics/switch-example.gifbin0 -> 25270 bytes
-rw-r--r--doc/src/declarative/propertybinding.qdoc103
-rw-r--r--doc/src/declarative/qmldocument.qdoc188
-rw-r--r--doc/src/declarative/qmlforcpp.qdoc713
-rw-r--r--doc/src/declarative/qmlmodels.qdoc110
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc103
-rw-r--r--doc/src/declarative/qtprogrammers.qdoc3
-rw-r--r--doc/src/declarative/scope.qdoc49
-rw-r--r--doc/src/declarative/tutorial.qdoc6
-rw-r--r--doc/src/declarative/tutorial1.qdoc3
-rw-r--r--doc/src/declarative/tutorial2.qdoc3
-rw-r--r--doc/src/declarative/tutorial3.qdoc3
21 files changed, 957 insertions, 996 deletions
diff --git a/doc/src/declarative/binding.qdoc b/doc/src/declarative/binding.qdoc
index 4f9bdc8..94465a1 100644
--- a/doc/src/declarative/binding.qdoc
+++ b/doc/src/declarative/binding.qdoc
@@ -40,37 +40,6 @@
****************************************************************************/
/*!
-\page binding.html
-\title Data Binding in QML
-\target binding
-
-Data binding provides a declarative way of specifying the data associated with objects, as well as the relationship between data of different objects. For example, you could bind the text of a label to the value of a slider: as the value of the slider changed, the label would be automatically updated with the new value.
-
-Bindings are created in QML when an expression is assigned to a property. For example, the following produces two rectangles of equal size (\c rect2 is bound to the size of \c rect1):
-\code
-Rectangle { id: rect1; width: 100; height: 100 }
-Rectangle { id: rect2; width: rect1.width; height: rect1.height }
-\endcode
-
-There is also a special \l Binding element, which is typically used to bind from the UI to the underlying UI model (see \l {Passing Data Between C++ and QML} for an example of this). The bindings above could be expressed using the \l Binding element as:
-
-\code
-Binding { target: rect2; property: "width"; value: rect1.width }
-Binding { target: rect2; property: "height"; value: rect1.height }
-\endcode
-
-In addition to binding directly to a property, you can also bind to the results of expressions involving properties. For example:
-\code
-Text { text: contact.firstname + ' ' + contact.lastname }
-Image { source: if (contact.gender == "female") {"pics/female.png"} else {"pics/male.png"} }
-\endcode
-
-Relevant items can also be bound to the contents of a model - see \l ListView for an example of this.
-
-Data can be bound to C++ objects - see \l {QML/C++ Data Binding}.
-*/
-
-/*!
\page qtbinding.html
\target qtbinding
\title QML/C++ Data Binding
diff --git a/doc/src/declarative/cppitem.qdoc b/doc/src/declarative/cppitem.qdoc
deleted file mode 100644
index c5ef4c4..0000000
--- a/doc/src/declarative/cppitem.qdoc
+++ /dev/null
@@ -1,170 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page cppitem.html
-\target cppitem
-\title C++ Components for QML
-
-\section1 Making a C++ object available in QML
-
-In QML, the item types and properties correspond to Qt objects and properties. Thus, any Qt object
-can potentially be used as an item in QML. More specifically, to make an object available in QML,
-it should:
-\list
-\o Be a subclass of QObject.
-\o Provide a default constructor.
-\o Declare Q_PROPERTYs.
-\o Be registered via the QML_DECLARE_TYPE and QML_DEFINE_TYPE macros.
-\endlist
-
-\section2 Declaring Q_PROPERTYs
-\target properties
-
-Properties of QObject subclasses are available as properties in QML.
-Like any QObject, these properties are defined by the Q_PROPERTY
-macro in the header file.
-
-Properties should have a NOTIFY function if they can change dynamically and
-if any useful response could be made to them changing in another object. Almost
-all properties will thus need a NOTIFY function.
-
-\code
- Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged);
- qreal scale() const;
- void setScale(qreal);
- ...
- signals: void scaleChanged();
-\endcode
-
-The property types currently supported by QML are:
-\list
-\o int
-\o qreal
-\o QString
-\o QColor
-\o QDate, QTime, and QDateTime
-\o QSize and QSizeF
-\o QPoint and QPointF
-\o QRect and QRectF
-\o QPixmap
-\o QIcon
-\o enums registered with Q_ENUMS
-\o flags registered with Q_FLAGS
-\o QVariant
-\o QObject* (or subclass)
-\endlist
-
-Custom property types that provide string-to-type conversion can be used as well, by:
-\list
-\o Registering them as a metatype (Q_DECLARE_METATYPE() and qRegisterMetaType())
-\o Registering a string-to-type convertor function (QML::addCustomStringConvertor()).
-\endlist
-
-\section2 Registering your type
-\target register
-
-In order for your type to be usable in QML, you must register it:
-
-\code
-QML_DECLARE_TYPE(TypeName);
-QML_DEFINE_TYPE(ModuleUri,ModuleMajorVersion,ModuleMinorVersionFrom,ModuleMinorVersionTo,QmlName,TypeName);
-\endcode
-
-These macros make the C++ \e TypeName available from the declarative markup language under the name \e QmlName.
-Of course there's nothing stopping you using the same name for both the C++ and the QML name!
-
-For example:
-\code
-QML_DECLARE_TYPE(MyCircle);
-QML_DEFINE_TYPE(MyLib,1,0,5,Circle,MyCircle);
-\endcode
-would make the \e MyCircle class accessable though the \c Circle type in QML whenever MyLib 1.0 to 1.5 is imported.
-
-
-\section1 Creating a new type of QML item in C++
-
-You can create a new type of QML item by:
-\list 1
-\o Creating a subclass of QFxItem,
-\o Adding Q_PROPERTYs appropriate for your item (see \l {properties}{Properties}),
-\o Reimplementing the relevant paint functions,
-\o Registering the type with the QML_DECLARE_TYPE and QML_DEFINE_TYPE macros (see \l {register}{Register}).
-\endlist
-
-\section2 Creating a subclass of QFxItem
-
-To add a new type, you first must add a new C++ class derived from QFxItem.
-You may of course extend existing QFxItem subclasses.
-
-One existing subclass is QFxPaintedItem, which provides
-a simple cached-image painting model.
-
-\section2 Reimplementing paint functions
-
-\warning This section is out of date. Use the normal QGraphicsItem::paint function.
-
-Two alternative painters are available, offering
-different levels of performance and functionality:
-QPainter, GLPainter.
-
-You can choose to subclass QFxPaintedItem rather than QFxItem,
-and then implement the virtual method:
-
-\code
- void drawContents(QPainter *painter, const QRect &rect);
-\endcode
-
-This paints into an offscreen pixmap which is then painted to the display (transformed,
-etc. as needed). The cost of this offscreen pixmap should be carefully considered, as
-should the specific performance of the painting done in the paint function.
-
-If you require more control, subclass QFxItem instead.
-QFxItem subclasses must implement both simple software canvas painting
-and GL painting:
-\list
-\o \c QFxItem::paintContents(QPainter &) for the simple software canvas,
-\o \c QFxItem::paintGLContents(GLPainter &) for OpenGL.
-\endlist
-
-See the documentation of those functions for detailed subclassing notes.
-
-*/
diff --git a/doc/src/declarative/ecmascriptblocks.qdoc b/doc/src/declarative/ecmascriptblocks.qdoc
new file mode 100644
index 0000000..815c68c
--- /dev/null
+++ b/doc/src/declarative/ecmascriptblocks.qdoc
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlecmascript.html
+\title ECMAScript Blocks
+
+QML encourages building UIs declaratively, using \l {Property Binding} and the
+composition of existing \l {QML Elements}. If imperative code is required to implement
+more advanced behavior, the \l Script element can be used to add ECMAScript code directly
+to a QML file, or to include an external ECMAScript file.
+
+The \l Script element is a QML language \e intrinsic. It can be used anywhere in a
+QML file, \e except as the root element of a file or sub-component, but cannot be
+assigned to an object property or given an id. The included ECMAScript is evaluated
+in a scope chain. The \l {QML Scope} documentation covers the specifics of scoping
+in QML.
+
+\section1 Inline Script
+
+Small blocks of ECMAScript can be included directly inside a \l {QML Document} as
+the body of the \l Script element.
+
+\code
+Rectangle {
+ Script {
+ function factorial(var a) {
+ a = Integer(a);
+ if (a <= 0)
+ return 1;
+ else
+ return a * factorial(a - 1);
+ }
+ }
+}
+\endcode
+
+Good programming practice dictates that only small script snippets should be written
+inline. QML prohibits the declaration of anything other than functions in an inline
+script block. For example, the following script is illegal as an inline script block
+as it declares the non-function variable \c lastResult.
+
+\code
+// Illegal inline code block
+var lastResult = 0
+function factorial(var a) {
+ a = Integer(a);
+ if (a <= 0)
+ lastResult = 1;
+ else
+ lastResult = a * factorial(a - 1);
+ return lastResult;
+}
+\endcode
+
+\section1 Including an External File
+
+To avoid cluttering the QML file, large script blocks should be in a separate file.
+The \l Script element's \c source property is used to load script from an external
+file.
+
+If the previous factorial code that was illegal as an inline script block was saved
+into a "factorial.js" file, it could be included like this.
+
+\code
+Rectangle {
+ Script {
+ source: "factorial.js"
+ }
+}
+\endcode
+
+The \c source property may reference a relative file, or an absolute path. In the
+case of a relative file, the location is resolved relative to the location of the
+\l {QML Document} that contains the \l Script element. If the script file is not
+accessible, an error will occur. If the source is on a network resource, the
+enclosing QML document will remain in the \l {QmlComponent::status()}{waiting state}
+until the script has been retrieved.
+
+\section1 Running Script at Startup
+
+It is occasionally necessary to run a block of ECMAScript code at application (or
+component instance) "startup". While it is tempting to just include the startup
+script as \e {global code} in an external script file, this can have sever limitations
+as the QML environment may not have been fully established. For example, some objects
+might not have been created or some \l {Property Binding}s may not have been run.
+\l {QML Script Restrictions} covers the exact limitations of global script code.
+
+The QML \l Component element provides an \e attached \c onCompleted property that
+can be used to trigger the execution of script code at startup after the
+QML environment has been completely established.
+
+The following QML code shows how to use the \c Component::onCompleted property.
+
+\code
+Rectangle {
+ Script {
+ function startupFunction() {
+ // ... startup code
+ }
+ }
+
+ Component.onCompleted: startupFunction();
+}
+\endcode
+
+Any element in a QML file - including nested elements and nested QML component
+instances - can use this attached property. If there is more than one script to
+execute at startup, they are run sequentially in an undefined order.
+
+\section1 QML Script Restrictions
+
+QML \l Script blocks contain standard ECMAScript code. QML introduces the following
+restrictions.
+
+\list
+\o Script code cannot modify the global object.
+
+In QML, the global object is constant - existing properties cannot be modified or
+deleted, and no new properties may be created.
+
+Most ECMAScript programs do not explicitly modify the global object. However,
+ECMAScript's automatic creation of undeclared variables is an implicit modification
+of the global object, and is prohibited in QML.
+
+Assuming that the \c a variable does not exist in the scope chain, the following code
+is illegal in QML.
+
+\code
+// Illegal modification of undeclared variable
+a = 1;
+for (var ii = 1; ii < 10; ++ii) a = a * ii;
+print("Result: " + a);
+\endcode
+
+It can be trivially modified to this legal code.
+
+\code
+var a = 1;
+for (var ii = 1; ii < 10; ++ii) a = a * ii;
+print("Result: " + a);
+\endcode
+
+Any attempt to modify the global object - either implicitly or explicitly - will
+cause an exception. If uncaught, this will result in an warning being printed,
+that includes the file and line number of the offending code.
+
+\o Global code is run in a reduced scope
+
+During startup, if a \l Script block includes an external file with "global"
+code, it is executed in a scope that contains only the external file itself and
+the global object. That is, it will not have access to the QML objects and
+properties it \l {QML Scope}{normally would}.
+
+Global code that only accesses script local variable is permitted. This is an
+example of valid global code.
+
+\code
+var colors = [ "red", "blue", "green", "orange", "purple" ];
+\endcode
+
+Global code that accesses QML objects will not run correctly.
+
+\code
+// Invalid global code - the "rootObject" variable is undefined
+var initialPosition = { rootObject.x, rootObject.y }
+\endcode
+
+This restriction exists as the QML environment is not yet fully established.
+To run code after the environment setup has completed, refer to
+\l {Running Script at Startup}.
+
+\endlist
+
+*/
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index cb30a6e..4fa4ec5 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -40,7 +40,7 @@
****************************************************************************/
/*!
-\page elements.html
+\page qmlelements.html
\target elements
\title QML Elements
@@ -185,6 +185,13 @@ The following table lists the QML elements provided by the Qt Declarative module
\o
\list
+\o \l Blur
+\o \l Colorize
+\o \l Grayscale
+\o \l Pixelize
+\o \l DropShadow
+\o \l Opacity
+\o \l Bloom
\o \l Particles
\list
\o \l ParticleMotionLinear
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index 5408098..9d66089 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -41,8 +41,9 @@
/*!
\page qmlexamples.html
-\target qmlexamples
-\title QML Examples
+\title QML Examples and Walkthroughs
+
+\section1 Running Examples
A \l {qmlviewer}{viewer} application is included that allows you to quickly explore many of the
examples. It has some useful options, revealed by:
@@ -64,12 +65,47 @@ or
Many other simple examples can be found under the \c examples/declarative sub
directory. Some can be run directly using the viewer like those above, and
-others require you to build and run an executable.
+others require you to build and run an executable. More sophisticated demos of
+large applications can be found under the \c demos/declarative sub directory.
+These are intended to show more integrated functionality rather than to be
+instructive on specific elements.
+
+\section1 Examples
+
+These will be documented, and demonstrate how to achieve various things in QML.
-More sophisticated demos of large applications can be found under the \c demos/declarative
-sub directory. These are intended to show more integrated functionality rather than
-to be instructive on specific elements.
+\raw HTML
+<center>
+<table cellspacing="10">
+<tr>
+<td>
+\endraw
+\image dial-example.gif
+\raw HTML
+</td>
+<td>
+\endraw
+\image switch-example.gif
+\raw HTML
+</td>
+<td>
+\endraw
+\image declarative-adv-tutorial4.gif
+\raw HTML
+</td>
+</tr>
+<tr>
+<td>
+<center>Elastic Dial</center>
+</td>
+<td>
+<center>Touch Toggle Switch</center>
+</td>
+<td>
+<center>Samegame</center>
+</td>
+</table>
+</center>
+\endraw
-Finally, check out the \l {tutorial} to learn a little more about writing your
-own QML-based applications.
*/
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
index 649eab1..db35961 100644
--- a/doc/src/declarative/extending.qdoc
+++ b/doc/src/declarative/extending.qdoc
@@ -511,6 +511,18 @@ to be used in bindings should have a NOTIFY signal instead.
\l {Extending QML - Binding Example} shows the BirthdayParty example updated to
include NOTIFY signals for use in binding.
+\section1 Binding and Script Properties
+
+While generally no changes are needed to a C++ class to use property
+binding, sometimes more advanced interaction between the binding engine and
+an object is desirable. To facilitate this, there is a special exception
+in the bind engine for allowing an object to access the binding directly.
+
+If a binding is assigned to a property with a type of QmlBinding
+pointer (ie. \c {QmlBinding *}), each time the binding value changes,
+a QmlBinding instance is assigned to that property. The QmlBinding instance
+allows the object to read the binding and to evaluate the binding's current value.
+
\section1 Extension Objects
\snippet examples/declarative/extending/extended/example.qml 0
@@ -522,15 +534,59 @@ When integrating existing classes and technology into QML, their APIs will often
need to be tweaked to fit better into the declarative environment. Although
the best results are usually obtained by modifying the original classes
directly, if this is either not possible or is complicated by some other
-concerns extension objects allow limited extension possibilities without
+concerns, extension objects allow limited extension possibilities without
direct modifications.
-Extension objects can only add properties.
+Extension objects are used to add additional properties to an existing type.
+Extension objects can only add properties, not signals or methods. An extended
+type definition allows the programmer to supply an additional type - known as the
+extension type - when registering the target class whose properties are
+transparently merged with the original target class when used from within QML.
+
+An extension class is a regular QObject, with a constructor that takes a QObject
+pointer. When needed (extension classes are delay created until the first extended
+property is accessed) the extension class is created and the target object is
+passed in as the parent. When an extended property on the original is accessed,
+the appropriate property on the extension object is used instead.
+
+When an extended type is installed, one of the
+\code
+ #define QML_DEFINE_EXTENDED_TYPE(URI, VMAJ, VFROM, VTO, QmlName,T, ExtendedT)
+ #define QML_DEFINE_EXTENDED_NOCREATE_TYPE(T, ExtendedT)
+\endcode
+macros should be used instead of the regular \c QML_DEFINE_TYPE or
+\c QML_DEFINE_NOCREATE_TYPE. The arguments are identical to the corresponding
+non-extension object macro, except for the ExtendedT parameter which is the type
+of the extension object.
\section1 Optimization
-*/
+Often to develop high performance elements it is helpful to know more about the
+status of the QML engine. For example, it might be beneficial to delay
+initializing some costly data structures until after all the properties have been
+set.
+The QML engine defines an interface class called QmlParserStatus, which contains a
+number of virtual methods that are invoked at various stages during component
+instantiation. To receive these notifications, an element implementation inherits
+QmlParserStatus and notifies the Qt meta system using the Q_INTERFACES() macro.
+
+For example,
+
+\code
+class Example : public QObject, public QmlParserStatus
+{
+ Q_OBJECT
+ Q_INTERFACES(QmlParserStatus)
+public:
+ virtual void componentComplete()
+ {
+ qDebug() << "Woohoo! Now to do my costly initialization";
+ }
+};
+\endcode
+
+*/
/*!
\page qml-extending-types.html
@@ -645,13 +701,13 @@ value, a property alias includes a compulsary alias reference. The alias
reference is used to locate the aliased property. While similar to a property
binding, the alias reference syntax is highly restricted.
-An alias reference takes the form
+An alias reference takes one of the following forms
\code
<Id>.<property>
+ <Id>
\endcode
where <Id> must refer to an object id within the same component as the type
-declaring the alias, and <property> refers to a property on this object. The
-alias reference syntax may become more flexibly in future releases.
+declaring the alias, and, optionally, <property> refers to a property on that object.
Here is the property definition example rewritten to use property aliases.
\code
diff --git a/doc/src/declarative/network.qdoc b/doc/src/declarative/network.qdoc
new file mode 100644
index 0000000..da4495f
--- /dev/null
+++ b/doc/src/declarative/network.qdoc
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlnetwork.html
+\title Network Transparency
+
+QML supports network transparency by using URLs (rather than file names) for all
+references from a QML document to other content. Since a \i relative URL is the same
+as a relative file, development of QML on regular file systems remains simple.
+
+\section1 Accessing Network Reesources from QML
+
+Whenever an object has a property of type URL (QUrl), assigning a string to that
+property will actually assign an absolute URL - by resolving the string against
+the URL of the document where the string is used.
+
+For example, consider this content in \c{http://example.com/mystuff/test.qml}:
+
+\code
+Image {
+ source: "images/logo.png"
+}
+\endcode
+
+The \l Image source property will be assigned \c{http://example.com/mystuff/images/logo.png},
+but while the QML is being developed, in say \c C:\User\Fred\Documents\MyStuff\test.qml, it will be assigned
+\c C:\User\Fred\Documents\MyStuff\images\logo.png.
+
+Network transparency is supported throughout QML:
+
+\list
+\o Types - if the \c test.qml file above used "Hello { }", that would refer to \c http://example.com/mystuff/Hello.qml
+\o Scripts - the \c source property of \l Script is a URL
+\o Images - the \c source property of \l Image and similar types is a URL
+\o Fonts - the \c source property of FontLoader is a URL
+\o WebViews - the \c url property of WebView may be assigned a relative URL string
+\endlist
+
+Because of the declarative nature of QML and the asynchronous nature of network resources,
+objects which reference network resource generally change state as the network resource loads.
+For example, an Image with a network source will initially have
+a \c width and \c height of 0, a \c status of \c Loading, and a \c progress of 0.0.
+While the content loads, the \c progress will increase until
+the content is fully loaded from the network,
+at which point the \c width and \c height become the content size, the \c status becomes \c Ready, and the \c progress reaches 1.0.
+Applications can bind to these changing states to provide visual progress indicators where appropriate, or simply
+bind to the \c width and \c height as if the content was a local file, adapting as those bound values change.
+
+Note that when objects reference local files they immediately have the \c Ready status, but applications wishing
+to remain network transparent should not rely on this. Future versions of QML may also use asynchronous local file I/O
+to improve performance.
+
+\section1 Limitations
+
+The \c import statement only works network transparently if it has an "as" clause.
+
+\list
+\o \c{import "dir"} only works on local file systems
+\o \c{import libraryUri} only works on local file systems
+\o \c{import "dir" as D} works network transparently
+\o \c{import libraryUrl as U} works network transparently
+\endlist
+
+\section1 Configuring the Network Access Manager
+
+All network access from QML is managed by a QNetworkAccessManager set on the QmlEngine which executes the QML.
+By default, this is an unmodified Qt QNetworkAccessManager. You may set a different manager using
+QmlEngine::setNetworkAccessManager() as appropriate for the policies of your application.
+For eample, the \l qmlviewer tool sets a new QNetworkAccessManager which
+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.
+
+\section1 QRC Resources
+
+One of the URL schemes built into Qt is the "qrc" scheme. This allows content to be compiled into
+the executable using \l{The Qt Resource System}. Using this, an executable can reference QML content
+that is compiled into the executable:
+
+\code
+ QmlView *canvas = new QmlView;
+ canvas->setUrl(QUrl("qrc:/dial.qml"));
+\endcode
+
+The content itself can then use relative URLs, and so be transparently unaware that the content is
+compiled into the executable.
+
+*/
diff --git a/doc/src/declarative/pics/anatomy-component.png b/doc/src/declarative/pics/anatomy-component.png
new file mode 100644
index 0000000..70ed983
--- /dev/null
+++ b/doc/src/declarative/pics/anatomy-component.png
Binary files differ
diff --git a/doc/src/declarative/pics/dial-example.gif b/doc/src/declarative/pics/dial-example.gif
new file mode 100644
index 0000000..4e90ba9
--- /dev/null
+++ b/doc/src/declarative/pics/dial-example.gif
Binary files differ
diff --git a/doc/src/declarative/pics/switch-example.gif b/doc/src/declarative/pics/switch-example.gif
new file mode 100644
index 0000000..3d6582f
--- /dev/null
+++ b/doc/src/declarative/pics/switch-example.gif
Binary files differ
diff --git a/doc/src/declarative/propertybinding.qdoc b/doc/src/declarative/propertybinding.qdoc
new file mode 100644
index 0000000..4cf08d8
--- /dev/null
+++ b/doc/src/declarative/propertybinding.qdoc
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page propertybinding.html
+\title Property Binding
+
+Property binding is a declarative way of specifying the value of a property. Binding allows
+a property's value to be expressed as an ECMAScript expression that defines the value relative
+to other property values or data accessible in the application. The property value is
+automatically kept up to date if the other properties or data values change.
+
+Property bindings are created implicitly in QML whenever an property is assigned an ECMAScript
+expression. The following QML uses two property bindings to connect the size of the rectangle
+to that of \c otherItem.
+
+\code
+Rectangle {
+ width: otherItem.width
+ height: otherItem.height
+}
+\endcode
+
+QML extends a standards compliant ECMAScript engine, so any valid ECMAScript expression can be
+used as a property binding. Bindings can access object properties, make function calls and even
+use builtin ECMAScript objects like \e {Date} and \e {Math}. Assigning a constant value to a
+property can even be thought of as a binding - afterall, a constant is a valid ECMAScript
+expression! Here are some examples of more complex bindings:
+
+\code
+Rectangle {
+ Script {
+ function calculateMyWidth() {
+ return Math.max(otherItem.width, thirdItem.width);
+ }
+ }
+
+ anchors.centerIn: parent
+ width: Math.min(otherItem.width, 10)
+ height: calculateMyWidth()
+ color: { if (width > 10) "blue"; else "red" }
+}
+\endcode
+
+Being ECMAScript expressions, bindings are evaluated in a scope chain. The \l {QML Scope}
+documentation covers the specifics of scoping in QML.
+
+\list
+\o When does a binding not get updated?
+\o Scope
+\o Assigning a constant/other binding clears existing binding
+\o Loops
+\o Using model data
+\endlist
+
+\section1 Binding Element
+
+The implicit binding syntax shown previously is easy to use and works perfectly for most uses
+of bindings. In some advanced cases, it is necessary to create bindings explicitly using the
+\l Binding element.
+
+One such example is included in the \l {Passing Data Between C++ and QML} documentation.
+\sa {QML/C++ Data Binding}
+*/
+
diff --git a/doc/src/declarative/qmldocument.qdoc b/doc/src/declarative/qmldocument.qdoc
new file mode 100644
index 0000000..84e7926
--- /dev/null
+++ b/doc/src/declarative/qmldocument.qdoc
@@ -0,0 +1,188 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmldocuments.html
+\title QML Documents
+
+A QML document is a block of QML source code. QML documents generally correspond to files
+stored on a disk or network resource, but can be constructed directly from text data.
+
+A simple QML document looks like this:
+
+\code
+import Qt 4.6
+
+Rectangle {
+ width: 240; height: 320;
+
+ resources: [
+ Component {
+ id: contactDelegate
+ Text {
+ text: modelData.firstName + " " + modelData.lastName
+ }
+ }
+ ]
+
+ ListView {
+ anchors.fill: parent
+ model: contactModel
+ delegate: contactDelegate
+ }
+}
+\endcode
+
+A QML document always begins with one or more import statements. To prevent elements
+introduced in later versions from affecting existing QML programs, the element types
+available within a document are controlled by the imported QML \l {Modules}. That is,
+QML is a \e versioned language.
+
+Syntactically a QML document is self contained; QML does \e not have a preprocessor that
+modifies the document prior to presentation to the QML runtime. \c import statements
+do not "include" code in the document, but instead instruct the QML runtime on how to
+resolve type references found in the document. Any type reference present in a QML
+document - such as \c Rectangle and \c ListView - including those made within an
+\l {ECMAScript Block} or \l {Property Binding}s, are \e resolved based exclusively on the
+import statements. QML does not import any modules by default, so at least one \c import
+statement must be present or no elements will be available!
+
+A QML document defines a single, top-level \l {QmlComponent}{QML component}. A QML component
+is a template that is interpreted by the QML runtime to create an object with some predefined
+behaviour. As it is a template, a single QML component can be "run" multiple times to
+produce several objects, each of which are said to be \e instances of the component.
+
+Once created, instances are not dependent on the component that created them, so they can
+operate on independent data. Here is an example of a simple "button" component that is
+instantiated four times, each with a different value for its \c text property.
+
+\table
+\row
+\o
+\raw HTML
+<table><tr><td>
+\endraw
+\code
+import Qt 4.6
+
+BorderImage {
+ property alias text: textElement.text
+ width: 100; height: 30; source: "images/toolbutton.sci"
+
+ Text {
+ id: textElement
+ anchors.centerIn: parent
+ font.pointSize: 20
+ style: Text.Raised
+ color: "white"
+ }
+}
+\endcode
+\raw HTML
+</td> <td>
+\endraw
+\image anatomy-component.png
+\raw HTML
+</td> </tr> </table>
+\endraw
+\endtable
+
+In addition to the top-level component that all QML documents define, documents may also
+include additional \e inline components. Inline components are declared using the
+\l Component element, as can be seen in the first example above. Inline components share
+all the characteristics of regular top-level components and use the same \c import list as their
+containing QML document. Components are one of the most basic building blocks in QML, and are
+frequently used as "factories" by other elements. For example, the \l ListView element uses the
+\c delegate component as the template for instantiating list items - each list item is just a
+new instance of the component with the item specific data set appropriately.
+
+Like other \l {QML Elements}, the \l Component element is an object and must be assigned to a
+property. \l Component objects may also have an object id. In the first example on this page,
+the inline component is added to the \l Rectangle's \c resources list, and then
+\l {Property Binding} is used to assign the \l Component to the \l ListView's \c delegate
+property. While using property binding allows the \l Component object to be shared (for example,
+if the QML document contained multiple \l ListView's with the same delegate), in this case the
+\l Component could have been assigned directly to the \l ListView's \c delegate. The QML
+language even contains a syntactic optimization when assigning directly to a component property
+for this case where it will automatically insert the \l Component tag.
+
+These final two examples are behaviorally identical to the original document.
+
+\table
+\row
+\o
+\code
+import Qt 4.6
+
+Rectangle {
+ width: 240; height: 320;
+
+ ListView {
+ anchors.fill: parent
+ model: contactModel
+ delegate: Component {
+ Text {
+ text: modelData.firstName + " " + modelData.lastName
+ }
+ }
+ }
+}
+\endcode
+\o
+\code
+import Qt 4.6
+
+Rectangle {
+ width: 240; height: 320;
+
+ ListView {
+ anchors.fill: parent
+ model: contactModel
+ delegate: Text {
+ text: modelData.firstName + " " + modelData.lastName
+ }
+ }
+}
+\endcode
+\endtable
+
+\sa QmlComponent
+*/
diff --git a/doc/src/declarative/qmlforcpp.qdoc b/doc/src/declarative/qmlforcpp.qdoc
deleted file mode 100644
index 5378571..0000000
--- a/doc/src/declarative/qmlforcpp.qdoc
+++ /dev/null
@@ -1,713 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qmlforcpp.html
- \target qmlforcpp
- \title QML for C++ Programmers
-
- This page describes the QML format and how to use and extend it from C++.
-
- The QML syntax declaratively describes how to construct an in memory
- object tree. QML is usually used to describe a visual scene graph
- but it is not conceptually limited to this: the QML format is an abstract
- description of \bold any object tree.
-
- QML also includes property bindings. Bindings are ECMAScript expressions
- of a properties value. Whenever the value of the expression changes -
- either for the first time at startup or subsequently thereafter - the
- property is automatically updated with the new value.
-
- \tableofcontents
-
- \section1 Loading and using QML Files
-
- QmlComponent is used to load a QML file and to create object instances.
-
- In QML a component is the unit of instantiation, and the most basic unit
- of scope. A component is like a template for how to construct an object
- tree. One component can create multiple instances of this tree, but the
- template remains constant.
-
- The following code uses the C++ interface to create 100 red rectangles
- based on a simple declarative component description.
-
- \code
- QmlEngine engine;
- QmlComponent redRectangle(&engine, "Rectangle { color: \"red\"; width: 100; height: 100 }");
- for (int ii = 0; ii < 100; ++ii) {
- QObject *rectangle = redRectangle.create();
- // ... do something with the rectangle ...
- }
- \endcode
-
- Each independent file describes a QML component, but it is also possible to
- create sub-components within a QML file as will be shown later.
-
- \section1 QML Format 101
-
- This is some sample QML code.
-
- \code
- Image {
- id: myRect
- x: 10
- y: 10
- width: 100
- height: 100
- source: "background.png"
-
- Text {
- height: 50
- width: 100
- color: "white"
- font.fontSize: 16
- text: "Hello world!"
- }
- }
- \endcode
-
- The QML snippet shown above instantiates one \c Image instance and one
- \c Text instance and sets properties on both. \bold Everything in QML
- ultimately comes down to either instantiating an object instance, or
- assigning a property a value. QML relies heavily on Qt's meta object system
- and can only instantiate classes that derive from QObject.
-
- In the above example, each property is placed on its own line. You can
- also place multiple properties on one line by separating them with a
- semi-colon. The code below is equivalent to the example above.
-
- \code
- Image {
- id: myRect
- x: 10; y: 10; width: 100; height: 100
- source: "background.png"
- Text { height: 50; width: 100; color: "white"; font.fontSize: 16; text: "Hello world!" }
- }
- \endcode
-
- QML can set properties that are more complex than just simple types like
- integers and strings. Properties can be object pointers or Qt interface
- pointers or even lists of object or Qt interface pointers! QML is typesafe,
- and will ensure that only the valid types are assigned to properties.
-
- Assigning an object to a property is as simple as assigning a basic
- integer. Attempting to assign an object to a property when type coercian
- fails will produce an error. The following shows an example of valid and of
- invalid QML and the corresponding C++ classes.
-
- \table
- \row \o
- \code
- class Image : public QObject
- {
- ...
- Q_PROPERTY(ImageFilter *filter READ filter WRITE setFilter)
- };
-
- class ImageFilter : public QObject
- {
- ...
- };
- \endcode
- \o \code
- // OK
- Image {
- filter: ImageFilter {}
- }
-
- // NOT OK: Image cannot be cast into ImageFilter
- Image {
- filter: Image {}
- }
- \endcode
- \endtable
-
- Classes can also define an optional default property. The default property
- is used for assignment if no explicit property has been specified.
- Any object property can be the default, even complex properties like lists
- of objects. The default property of the \c Rect class is the \c children
- property, a list of \c Item's. In the following example, as both \c Image
- and \c Text inherit from \c Item the \c Image and \c Text instances are
- added to the parent's \c children property.
-
- \code
- Rectangle {
- Image {}
- Text {}
- }
- \endcode
-
- Properties that return read-only object pointers can be used recursively.
- This can be used, for example, to group properties together. The
- \c Text element has a \c font property that returns an object with a number
- of sub-properties such as \c family, \c bold, \c italic and \c size.
- QML makes it easy to interact with these grouped properties, as the
- following shows - everything you would expect to work, just does.
-
- \table
- \row \o
- \code
- class Text : public ...
- {
- ...
- Q_PROPERTY(Font *font READ font);
- };
- class Font : public QObject
- {
- ...
- Q_PROPERTY(QString family READ family WRITE setFamily);
- Q_PROPERTY(bool bold READ bold WRITE setBold);
- Q_PROPERTY(bool italic READ italic WRITE setItalic);
- Q_PROPERTY(int size READ size WRITE setSize);
- };
- \endcode
- \o
- \code
- Text {
- font.family: "helvetica"
- font.pointSize: 12
- font {
- bold: true
- italic: true
- }
- }
- \endcode
- \endtable
-
- \section1 Defining QML Types
-
- The QML engine has no intrinsic knowledge of any class types. Instead
- the programmer must define the C++ types, their corresponding QML
- name, library namespace, and version availability.
-
- \code
- #define QML_DECLARE_TYPE(T)
- #define QML_DEFINE_TYPE(URI,VMAJ,VFROM,VTO,QmlName,T)
- \endcode
-
- Adding these macros to your library or executable automatically makes the
- C++ type \a T available from the declarative markup language under the
- name \a QmlName. Of course there's nothing stopping you using the same
- name for both the C++ and the QML name!
- Any type can be added to the QML engine using these macros. The only
- requirements are that \a T inherits QObject, is not abstract,
- and that it has a default constructor.
-
- \section1 Property Binding
-
- Assigning constant values and trees to properties will only get you so
- far. Property binding allows a property's value to be dependant on the
- value of other properties and data. Whenever these dependencies change,
- the property's value is automatically updated.
-
- Property bindings are ECMAScript expressions and can be applied to any
- object property. C++ classes don't have to do anything special to get
- binding support other than define appropriate properties. When a non-literal
- property assignment appears in a QML file, it is automatically treated as a
- property binding.
-
- Here's a simple example that stacks a red, blue and green rectangle.
- Bindings are used to ensure that the height of each is kept equal to it's
- parent's. Were the root rectangle's height property to change, the child
- rectangles height would be updated automatically.
-
- \code
- Rectangle {
- color: "red"
- width: 100
- Rectangle {
- color: "blue"
- width: 50
- height: parent.height
- Rectangle {
- color: "green"
- width: 25
- height: parent.height
- }
- }
- }
- \endcode
-
- Binding expressions execute in a context. A context behaves as a scope and
- defines how the expression resolves property and variable names. Although
- the two expressions in the last example are the same, the value of \c parent
- resolves differently because each executes in a different context. Although
- QML generally takes care of everything for the programmer, a thorough
- understanding of bind contexts is important in some of the more complex QML
- structures.
-
- Every expression is executed in a bind context, encapsulated by the
- QmlContext C++ class. As covered in the class documentation, a
- bind context contains a map of names to values, and a list of default
- objects. When resolving a name, the name to value map is searched first.
- If the name cannot be found, the default object's are iterated in turn and
- the context attempts to resolve the name as a property of one of the default
- objects.
-
- There are generally two contexts involved in the execution of a binding.
- The first is the "object context" - a bind context associated with the
- closest instantiated object and containing just one default object, and
- that's instantiated object itself. The effect of the object
- context is pretty simple - names in the binding expression resolve to
- properties on the object first. It is important to note - particularly in
- the case of grouped properties - the object context is that of the
- instantiated object, the consequences of which are shown below.
-
- \code
- // OK // NOT OK
- Text { Text {
- font { font {
- bold: font.italic bold: italic
- } }
- } }
- \endcode
-
- The second context is the "component context". Each QML component (and
- consequently each QML file) is created in its own unique binding context.
- Like the object context, the component context contains just one default
- object - but in this case it is the component's root object. An example
- will illustrate best - the resultant text will read "background.png".
-
- \code
- Image {
- source: "background.png"
- Text {
- text: source
- }
- }
- \endcode
-
- If the name is not found in either of these contexts, the context heirarchy
- is searched parent-by-parent until the name is either found, or the
- heirarchy is exhausted.
-
- The first property binding example shown involved fixing the height of three
- rectangles. It did this by fixing the height of each rectangle to its
- parent, rather than fixing them all to a single common point. Here's the
- example rewritten to do just that.
-
- \code
- Rectangle {
- color: "red"
- width: 100
- Rectangle {
- color: "blue"
- width: 50
- height: parent.height
- Rectangle {
- color: "green"
- width: 25
- height: parent.parent.height
- }
- }
- }
- \endcode
-
- Clearly this sort of fragile relationship is undesirable and unmanageable -
- moving the green rectangle to be a sibling of the blue or introducing a
- further rectangle between the two would break the example.
-
- To address this problem, QML includes a way to directly reference any object
- within a component (or parent component for that matter), called "ids".
- Developers assign an object an id, and can then reference it directly by
- name. Developers assign an object an id by setting the special \c id
- property. Every object automatically has this magical property (if the
- object also has an actual property called \c id, that gets set too). As
- an id allows an object to be referenced directly, it must be unique within
- a component. By convention, id's should start with an uppercase letter.
-
- \code
- Rectangle {
- id: root
- color: "red"
- width: greenRect.width + 75
- height: root.height
- Rectangle {
- color: "blue"
- width: greenRect.width + 25
- Rectangle {
- id: greenRect
- color: "green"
- width: 25
- height: root.height
- }
- }
- }
- \endcode
-
- To relate id's back to QmlContext, id's exist as properties on the
- component context.
-
- Bind expressions can reference any object property. The QML bind engine
- relies on the presence of the NOTIFY signal in the Q_PROPERTY declaration
- on a class to alert it that a property's value has changed. If this is
- omitted, the bind expression can still access the property's value, but
- the expression will not be updated if the value changes. The following is
- an example of a QML friendly property declaration.
-
- \code
- class Example : public QObject
- {
- Q_OBJECT
- Q_PROPERTY(int sample READ sample WRITE setSample NOTIFY sampleChanged)
- public:
- int sample() const;
- void setSample(int);
- signals:
- void sampleChanged(int);
- };
- \endcode
-
- While generally no changes are needed to a C++ class to use property
- binding, sometimes more advanced interaction between the binding engine and
- an object is desirable. To facilitate this, there is a special exception
- in the bind engine for allowing an object to access the binding directly.
-
- If a binding is assigned to a property with a type of QmlBindableValue
- pointer (ie. QmlBindableValue *), each time the binding value changes,
- a QmlBindableValue instance is assigned to that property. The
- QmlBindableValue instance allows the object to read the binding and to
- evaluate the binding's current value.
-
- \section1 Signal Properties
-
- In addition to reading and writing regular properties, QML allows you to
- easily associate ECMAScript with signals. Consider the following example,
- in which Button is a made-up type with a clicked() signal.
-
- \code
- Button {
- text: "Hello world!"
- onClicked: print(text)
- }
- \endcode
-
- Clicking on the button causes "Hello world!" to be printed to the console
- (or lost forever if you're running Windows).
-
- Like properties, signals automatically become available in QML without
- any additional work. As illustrated signals are mapped into QML as special
- "signal properties", using the name "on<Signal Name>" where the first
- character of the signal's name is uppercased. If more than one signal of
- the same name is exist on a class, only the first is available (see the
- \l Connection element for more general signal connections).
-
- An important observation to make here is the lack of braces. While both
- property bindings and signal properties involve executing ECMAScript code,
- property bindings dynamically update the property value (hence the braces),
- whereas with signal properties the constant script "value" is actually
- assigned to the signal property. Trying to bind a value to a signal
- property will not work!
-
- Signal parameters are also available to the executing script, as shown
- below, as long as you remember to name the parameters of your signal
- in C++ (see QMetaMethod::parameterNames()).
-
- \table
- \row \o
- \code
- Example {
- onDoSomething: for(var ii = 0; ii &lt; count; ++ii)
- print(message)
- }
- \endcode
- \o
- \code
- class Example : public QObject
- {
- Q_OBJECT
- signals:
- void doSomething(int count, const QString &message);
- };
- \endcode
- \endtable
-
- Just like property bindings, signal scripts are executed in a context. The
- signal script context is identical in scope to the "object context" under
- property binding, with the exception that it has the signal parameters
- bound in.
-
- In addition to scripts, it is possible to assign objects to signal properties.
- This automatically connects the signal to the object's default method. A
- default method is defined just like a default property, though the special
- "DefaultMethod" class info.
-
- \code
- Q_CLASSINFO("DefaultMethod", "myMethod(int)");
- \endcode
-
- This is useful in achieving several use cases, like that below which moves
- the button when it is clicked.
-
- \code
- Button {
- id: myButton
- onClicked: NumberAnimation {
- target: myButton
- property: "x"
- to: 100
- }
- }
- \endcode
-
- If the class itself actually defines a property called "on<Name>", this will
- be assigned the string value and the signal handling behaviour will be
- disabled.
-
- \section1 Attached Properties
-
- Attached properties allow unrelated types to annotate another type with some
- additional properties. Some APIs or operations are inherintly imperative,
- and attached properties help out when translating these APIs into the
- declarative QML language.
-
- Qt's QGridLayout is one such example.
-
- \code
- QGridLayout {
- QLabel {
- QGridLayout.row: 0
- QGridLayout.column: 0
- text: "Name:"
- }
- QLineEdit {
- QGridLayout.row: 0
- QGridLayout.column: 1
- }
-
- QLabel {
- QGridLayout.row: 1
- QGridLayout.column: 0
- text: "Occupation:"
- }
- QLineEdit {
- QGridLayout.row: 1
- QGridLayout.column: 1
- }
- }
- \endcode
-
- Attached properties are identified by the use of a type name, in the
- case shown \c QGridLayout, as a grouped property specifier. To prevent
- ambiguity with actual class instantiations, attached properties must
- always be specified to include a period but can otherwise be used just like
- regular properties.
-
- C++ types provide attached properties by declaring the public function \c qmlAttachedProperties like this example.
-
- \table
- \row \o
- \code
- static QObject *Type::qmlAttachedProperties(QObject *);
- \endcode
- \o
- \code
- class Example : public QObject
- {
- Q_OBJECT
- public:
- static QObject *qmlAttachedProperties(QObject *);
- };
- \endcode
- \endtable
-
- When an attached property is accessed, the QML engine will call this method
- to create an attachment object, passing in the object instance that the
- attached property applies to. The attachment object should define all
- the attached properties, and is generally parented to the provided object
- instance to avoid memory leaks. The QML engine does not saves this object,
- so it is not necessary for the attached property function to ensure that
- multiple calls for the same instance object return the same attached object.
-
- While conceptually simple, implementing an attachment object is not quite
- so easy. The \c qmlAttachedProperties function is static - attachment
- objects are not associated with any particular instance. How the values
- of the attached properties apply to the behaviour they are controlling is
- entirely implementation dependent. An additional consequence of this is
- that \bold any object can attach \bold any attached property. The following is
- perfectly valid, although the attached property has no actual effect:
-
- \code
- FancyGridLayout {
- Item {
- Button {
- QGridLayout.row: 1
- }
- }
- }
- \endcode
-
- The property has no effect because the (made-up) FancyGridLayout type defines the meaning
- of the \c row attached property only to apply to its direct children. It
- is possible that other types may have attached properties that affect
- objects that aren't their direct children.
-
- Attached properties are an advanced feature that should be used with
- caution.
-
- \note We may implement a convenience wrapper that makes using attached
- properties easier for the common "attach to children" case.
-
- \section1 Property Value Sources
-
- Intrinsically, the QML engine can assign a property either a static value,
- such as a number or an object tree, or a property binding. It is possible for
- advanced users to extend the engine to assign other "types" of values to
- properties. These "types" are known as property value sources.
-
- Consider the following example.
-
- \code
- Rectangle {
- x: NumberAnimation { running: true; repeat; true; from: 0; to: 100; }
- }
- \endcode
-
- Here the \c x property of the rectangle will be animated from 0 to 100.
- To support this, the NumberAnimation class inherits the
- QmlPropertyValueSource class. If a type inherits this class and is assigned
- to a property for which type assignment would otherwise fail (ie. the
- property itself doesn't have a type of QmlPropertyValueSource *), the QML
- engine will automatically set the property as the target of the value
- source.
-
- \section1 Parser Status
-
- Generally using QML is a breeze - you implement your classes in C++, add
- the appropriate properties, signals and slots and off you go. The QML
- engine takes care of instantiating your classes and setting the properties
- and everything works fine.
-
- However, sometimes it is helpful to know a little more about the status of
- the QML parser. For example, it might be beneficial from a performance
- standpoint to delay initializing some data structures until all the
- properties have been set.
-
- To assist with this, the QML engine defines an interface class called
- QmlParserStatus. The interface defines a number of virtual methods that are
- invoked at various stages of the component instantiation. To receive
- these notifications, all a class has to do is to inherit the interface, and
- notify the Qt meta system using the Q_INTERFACES() macro. For example,
-
- \code
- class Example : public QObject, public QmlParserStatus
- {
- Q_OBJECT
- Q_INTERFACES(QmlParserStatus)
- public:
- virtual void componentComplete()
- {
- qDebug() << "Woohoo! Now to do my costly initialization";
- }
- };
- \endcode
-
- \section1 Extended Type Definitions
-
- QML requires that types have the appropriate properties and signals to
- work well within the declarative environment. In the case of existing
- types, it is sometimes necessary to add signals, properties or slots to a
- target class to make it more QML friendly but the original type cannot be
- modified. For these cases, the QML engine supports extended type
- definitions.
-
- An extended type definition allows the programmer to supply an additional
- type - known as the extension type - when registering the target class
- whose properties, signals and slots are transparently merged with the
- original target class when used from within QML.
-
- An extension class is a regular QObject, with a constructor that takes a
- QObject pointer. When needed (extension classes are delay created
- until the first extension attribute is accessed) the extension
- class is created and the target object is passed in as the parent. When
- an extension attribute on the original is accessed, the appropriate signal,
- property or slots on the extension object is used instead.
-
- When an extended type is installed, the
- \code
- #define QML_DEFINE_EXTENDED_TYPE(T,QmlName,ExtendedTypeName)
- \endcode
- macro should be used instead of the regular \c QML_DEFINE_TYPE.
-
- This example shows the addition of a read-only \c textLength property to
- QLabel being implemented as an extension.
-
- \table
- \row
- \o
- \code
- class QLabelExtension : public QObject
- {
- Q_OBJECT
- Q_PROPERTY(int textLength READ textLength)
- public:
- QWidgetExtension(QObject *parent) : QObject(parent) {}
- int textLength() const {
- return static_cast<QLabel *>(parent())->text().count();
- }
- };
- QML_DEFINE_EXTENDED_TYPE(QLabel,QLabel,QLabelExtension);
- \endcode
- \o
- \code
- QLabel {
- id: label1
- text: "Hello World!"
- }
- QLabel {
- text: "label1 text length: " + label1.textLength
- }
- \endcode
- \endtable
-
- Attributes defined through extensions are inherited, just like attributes
- defined on a normal class. Any types that inherit from \c QLabel, will
- also have the \c textLength property. Derived types can include additional
- extensions which are merged together, but only a single extension can be
- specified for each single C++ class.
-
- Extended type definitions can even be used to add an attached properties
- function to a type - just declare the \c qmlAttachedProperties function on
- the extension object.
-
-*/
-
diff --git a/doc/src/declarative/qmlmodels.qdoc b/doc/src/declarative/qmlmodels.qdoc
index eca81cd..6ebb734 100644
--- a/doc/src/declarative/qmlmodels.qdoc
+++ b/doc/src/declarative/qmlmodels.qdoc
@@ -63,7 +63,7 @@ There are a number of QML elements that operate using data models:
\o ListView
\o GridView
\o PathView
-\o \l {qml-repeater}{Repeater}
+\o \l Repeater
\endlist
QML supports several types of data model, which may be provided by QML
@@ -71,14 +71,87 @@ or C++ (via QmlContext::setContextProperty(), for example).
\section1 QML Data Models
-\list
-\o ListModel is a simple hierarchy of elements specified in QML. The
+\section2 ListModel
+
+ListModel is a simple hierarchy of elements specified in QML. The
available roles are specified by the \l ListElement properties.
-\o XmlListModel allows construction of a model from an XML data source. The roles
+
+\code
+ListModel {
+ id: fruitModel
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ }
+}
+\endcode
+
+The above model has two roles, \e name and \e cost. These can be bound
+bound to by a ListView delegate, for example:
+
+\code
+Component {
+ id: fruitDelegate
+ Row {
+ Text { text: "Fruit: " + name }
+ Text { text: "Cost: $" + cost }
+ }
+}
+ListView {
+ model: fruitModel
+ delegate: fruitDelegate
+}
+\endcode
+
+
+\section2 XmlListModel
+
+XmlListModel allows construction of a model from an XML data source. The roles
are specified via the \l XmlRole element.
-\o VisualItemModel allows QML items to be provided as a model. This model contains
+
+The following model has three roles, \e title, \e link and \e description:
+\code
+XmlListModel {
+ id: feedModel
+ source: "http://rss.news.yahoo.com/rss/oceania"
+ query: "/rss/channel/item"
+ XmlRole { name: "title"; query: "title/string()" }
+ XmlRole { name: "link"; query: "link/string()" }
+ XmlRole { name: "description"; query: "description/string()" }
+}
+\endcode
+
+
+\section2 VisualItemModel
+
+VisualItemModel allows QML items to be provided as a model. This model contains
both the data and delegate (its child items). This model does not provide any roles.
-\endlist
+
+\code
+ VisualItemModel {
+ id: itemModel
+ Rectangle { height: 30; width: 80; color: "red" }
+ Rectangle { height: 30; width: 80; color: "green" }
+ Rectangle { height: 30; width: 80; color: "blue" }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: itemModel
+ }
+\endcode
+
+Note that in the above example there is no delegate required.
+The items of the model itself provide the visual elements that
+will be positioned by the view.
\section1 C++ Data Models
@@ -92,11 +165,28 @@ both the data and delegate (its child items). This model does not provide any r
\section1 Other Data Models
-\list
-\o An Integer specifies a model containing the integer number of elements.
+
+\section2 An Integer
+
+An Integer specifies a model containing the integer number of elements.
There are no data roles.
-\o An Object Instance specifies a model with a single Object element. The
+
+The following example creates a ListView with five elements:
+\code
+Component {
+ id: itemDelegate
+ Text { text: "I am item number: " + index }
+}
+ListView {
+ model: 5
+ delegate: itemDelegate
+}
+\endcode
+
+
+\section2 An Object Instance
+
+An Object Instance specifies a model with a single Object element. The
properties of the object are provided as roles.
-\endlist
*/
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index 1a13049..73814db 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -40,57 +40,68 @@
****************************************************************************/
/*!
- \module QtDeclarative
- \title QtDeclarative Module
- \ingroup modules
+\module QtDeclarative
+\title QtDeclarative Module
+\ingroup modules
- \brief The Qt Declarative module provides a declarative framework for building
- highly dynamic and fluid applications.
+\brief The Qt Declarative module provides a declarative framework for building
+highly dynamic, custom UIs
- Qt Declarative is targetted at the sorts of user
- interface (and the sorts of hardware) in embedded devices such as phones, media
- players, and set-top boxes. It is also appropriate for highly custom desktop
- user interfaces, or special elements in more traditional desktop
- user interfaces.
+Qt Declarative aids programmers and designers in building the animation rich,
+highly fluid user interfaces that are becoming common in portable consumer
+electronics devices, such as mobile phones, media players, set-top boxes and
+netbooks. The Qt Declarative module provides an engine for interpreting the
+declarative QML language, and a rich set of \l {QML Elements} that can be used
+from QML.
- Building fluid applications is done declaratively, rather than procedurally.
- That is, you specify \e what the UI should look like and how it should behave
- in an declarative format called QML, rather than specifying step-by-step \e how to
- build it in a language like C++ or JavaScript. Specifying a UI declaratively
- does not just include the layout of the interface items, but also the way each
- individual item looks and behaves and the overall flow of the application.
+QML is an extension to \l {http://www.ecma-international.org/publications/standards/Ecma-262.htm}
+{ECMAScript}, that provides a mechanism to declaratively build an object tree
+of \l {QML Elements}. QML improves the integration between ECMAScript and Qt's
+existing QObject based type system, adds support for automatic
+\l {Property Binding}s and provides \l {Network Transparency} at the language
+level.
- Getting Started:
- \list
- \o \l {Introduction to the QML language}
- \o \l {tutorial}{Tutorial: 'Hello World'}
- \o \l {tutorials-declarative-contacts.html}{Tutorial: 'Introduction to QML'}
- \o \l {advtutorial.html}{Advanced Tutorial: 'Same Game'}
- \o \l {qmlexamples}{Examples}
- \o \l {qmlforcpp}{QML For C++ Programmers}
- \endlist
+The \l {QML Elements} are a sophisticated set of graphical and behavioral building
+blocks. \l {QML Elements} are combined together in \l {QML Documents} to build components
+ranging in complexity from simple pushbuttons and sliders, to complete
+internet-enabled applications like a \l {http://www.flickr.com}{flickr} photo browser.
- Core QML Features:
- \list
- \o \l {binding}{Data Binding}
- \o \l {qmlmodels}{Data Models}
- \o \l {anchor-layout}{Anchor-based Layout}
- \o \l {qmlanimation}{Animation}
- \o \l {qmlmodules}{Modules}
- \o \l {qmlfocus}{Keyboard Focus}
- \o \l {Extending types from QML}
- \endlist
+Qt Declarative builds on \l {QML for Qt programmers}{Qt's existing strengths}.
+QML can be be used to incrementally extend an existing application or to build
+completely new applications. QML is fully \l {Extending QML}{extensible from C++}.
- QML Reference:
- \list
- \o \l {QML Format Reference}
- \o \l {elements}{QML Elements}
- \endlist
+\section1 Getting Started:
+\list
+\o \l {Introduction to the QML language}
+\o \l {Tutorial}{Tutorial: 'Hello World'}
+\o \l {tutorials-declarative-contacts.html}{Tutorial: 'Introduction to QML'}
+\o \l {advtutorial.html}{Advanced Tutorial: 'Same Game'}
+\o \l {QML Examples and Walkthroughs}
+\endlist
- C++ Reference:
- \list
- \o \l {Extending QML}
- \o \l {qtbinding}{QML/C++ Data Binding}
- \o \l {cppitem}{C++ Components}
- \endlist
+\section1 Core QML Features:
+\list
+\o \l {QML Documents}
+\o \l {Property Binding}
+\o \l {ECMAScript Blocks}
+\o \l {Network Transparency}
+\o \l {qmlmodels}{Data Models}
+\o \l {anchor-layout}{Anchor-based Layout}
+\o \l {qmlanimation}{Animation}
+\o \l {qmlmodules}{Modules}
+\o \l {qmlfocus}{Keyboard Focus}
+\o \l {Extending types from QML}
+\endlist
+
+\section1 QML Reference:
+\list
+\o \l {QML Format Reference}
+\o \l {QML Elements}
+\endlist
+
+\section1 C++ Reference:
+\list
+\o \l {Extending QML}
+\o \l {qtbinding}{QML/C++ Data Binding}
+\endlist
*/
diff --git a/doc/src/declarative/qtprogrammers.qdoc b/doc/src/declarative/qtprogrammers.qdoc
index 00c2d48..ea27d7e 100644
--- a/doc/src/declarative/qtprogrammers.qdoc
+++ b/doc/src/declarative/qtprogrammers.qdoc
@@ -65,8 +65,7 @@ QML provides direct access to the following concepts from Qt:
\o Qt models - used directly in data binding (QAbstractItemModel and next generation QListModelInterface)
\endlist
-Qt knowledge is \e required for \l {cppitem}{writing elements in C++}.
-
+Qt knowledge is \e required for \l {Extending QML}.
\section1 QML Items compared with QWidgets
diff --git a/doc/src/declarative/scope.qdoc b/doc/src/declarative/scope.qdoc
new file mode 100644
index 0000000..c35f3e3
--- /dev/null
+++ b/doc/src/declarative/scope.qdoc
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlscope.html
+\title QML Scope
+
+QML is a \e {dynamically scoped} language. \l {Property Binding}s and \l {ECMAScript Blocks}
+are executed
+
+*/
diff --git a/doc/src/declarative/tutorial.qdoc b/doc/src/declarative/tutorial.qdoc
index b59384c..19921c0 100644
--- a/doc/src/declarative/tutorial.qdoc
+++ b/doc/src/declarative/tutorial.qdoc
@@ -15,9 +15,9 @@ The tutorial's source code is located in the $QTDIR/examples/declarative/tutoria
Tutorial chapters:
\list
-\o \l {tutorial1}{Tutorial 1 - Basic Types}
-\o \l {tutorial2}{Tutorial 2 - QML Component}
-\o \l {tutorial3}{Tutorial 3 - States and Transitions}
+\o \l {Tutorial 1 - Basic Types}
+\o \l {Tutorial 2 - QML Component}
+\o \l {Tutorial 3 - States and Transitions}
\endlist
*/
diff --git a/doc/src/declarative/tutorial1.qdoc b/doc/src/declarative/tutorial1.qdoc
index ad454f2..f7e44b0 100644
--- a/doc/src/declarative/tutorial1.qdoc
+++ b/doc/src/declarative/tutorial1.qdoc
@@ -1,6 +1,5 @@
/*!
\page tutorial1.html
-\target tutorial1
\title Tutorial 1 - Basic Types
This first program is a very simple "Hello world" example that introduces some basic QML concepts.
@@ -52,6 +51,6 @@ For example, to run the provided completed Tutorial 1 example from the install l
bin/qmlviewer $QTDIR/examples/declarative/tutorials/helloworld/tutorial1.qml
\endcode
-[\l tutorial] [Next: \l tutorial2]
+[\l {Tutorial}] [Next: \l {Tutorial 2 - QML Component}]
*/
diff --git a/doc/src/declarative/tutorial2.qdoc b/doc/src/declarative/tutorial2.qdoc
index 796d0f9..ac63d9b 100644
--- a/doc/src/declarative/tutorial2.qdoc
+++ b/doc/src/declarative/tutorial2.qdoc
@@ -1,6 +1,5 @@
/*!
\page tutorial2.html
-\target tutorial2
\title Tutorial 2 - QML Component
This chapter adds a color picker to change the color of the text.
@@ -65,7 +64,7 @@ We create the color picker by putting 6 cells with different colors in a grid.
When the \e clicked signal of our cell is triggered, we want to set the color of the text to the color passed as a parameter.
We can react to any signal of our component through a property of the name \e 'onSignalName' (see \l{Signal Handlers}).
-[Previous: \l tutorial1] [Next: \l tutorial3]
+[Previous: \l {Tutorial 1 - Basic Types}] [Next: \l {Tutorial 3 - States and Transitions}]
*/
diff --git a/doc/src/declarative/tutorial3.qdoc b/doc/src/declarative/tutorial3.qdoc
index 8ef32d4..1e67eee 100644
--- a/doc/src/declarative/tutorial3.qdoc
+++ b/doc/src/declarative/tutorial3.qdoc
@@ -1,6 +1,5 @@
/*!
\page tutorial3.html
-\target tutorial3
\title Tutorial 3 - States and Transitions
In this chapter, we make this example a little bit more dynamic by introducing states and transitions.
@@ -41,6 +40,6 @@ We could also run them one after the other by using \l SequentialAnimation inste
For more details on states and transitions, see \l {states-transitions}{States and Transitions}.
-[Previous: \l tutorial2] [\l tutorial]
+[Previous: \l {Tutorial 2 - QML Component}] [\l {Tutorial}]
*/