aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2012-07-26 15:45:45 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-30 09:15:37 +0200
commite7b90ea3107996fb4a1b410631e0650d2d704912 (patch)
tree9a103f8aca8f1ed392aa197fb93be4450df071bd /src
parent1b3d4a94fdd578786529f51b4d25b560696fb610 (diff)
Improve QML basic types documentation
Basic types are provided either by the language (int, string, bool, real, double, date, url, var, variant) or by modules (value types). In 5.1 we would like modules to be able to provide more basic types, and thus a cleaner separation of the documentation makes sense. This patch also improves linking of the term QtQml so that a clear distinction is made between the QtQml QML module and the QtQml C++ Qt Module (the QtQml QML module links now point to the QtQml type reference page). Change-Id: Ibe3ad33e4616c5f29ea38dadc27e13938aedb9d7 Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/doc/src/javascript/dynamicobjectcreation.qdoc3
-rw-r--r--src/qml/doc/src/qmltypereference.qdoc212
-rw-r--r--src/qml/doc/src/qtqml.qdoc15
-rw-r--r--src/qml/doc/src/typesystem/basictypes.qdoc438
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp2
-rw-r--r--src/quick/doc/src/qmltypereference.qdoc297
-rw-r--r--src/quick/doc/src/qtquick.qdoc23
7 files changed, 531 insertions, 459 deletions
diff --git a/src/qml/doc/src/javascript/dynamicobjectcreation.qdoc b/src/qml/doc/src/javascript/dynamicobjectcreation.qdoc
index 78ce09d0ad..95deba52c6 100644
--- a/src/qml/doc/src/javascript/dynamicobjectcreation.qdoc
+++ b/src/qml/doc/src/javascript/dynamicobjectcreation.qdoc
@@ -64,7 +64,8 @@ Once you have a \l Component, you can call its \l {Component::createObject()}
can take one or two arguments:
\list
\li The first is the parent for the new object. The parent can be a graphical
- object (QtQuick item) or non-graphical object (QtQml QtObject or C++
+ object (QtQuick item) or non-graphical object
+ (\l{qtqml-typereference-topic.html}{QtQml} \l QtObject or C++
QObject). Only graphical objects with graphical parent objects will be
rendered to the QtQuick visual canvas. If you wish to set the parent later
you can safely pass \c null to this function.
diff --git a/src/qml/doc/src/qmltypereference.qdoc b/src/qml/doc/src/qmltypereference.qdoc
index 01b2578c23..04f0e48410 100644
--- a/src/qml/doc/src/qmltypereference.qdoc
+++ b/src/qml/doc/src/qmltypereference.qdoc
@@ -26,25 +26,26 @@
****************************************************************************/
/*!
\page qtqml-typereference-topic.html
-\title QML Types Provided By The Qt QML Module
-\brief List of QML types provided by the Qt QML module
+\title QML Types Provided By The QtQml Module
+\brief List of QML types provided by the QtQml module
-The Qt QML module provides the definition and implementation of the QML
-language, and it also provides some elementary QML types which provide the
-basis for further extensions to the QML language.
+The \c QtQml module provides the definition and implementation of various
+convenience types which can be used with the QML language, including some
+elementary QML types which can provide the basis for further extensions to the
+QML language.
-The Qt QML module also provides the \c QtObject and \c Component types which
-may be used in QML documents, by default. These types are non-visual and
-provide building-blocks for extensions to QML.
+The \c QtQml module provides the \c QtObject and \c Component object types
+which may be used in QML documents. These types are non-visual and provide
+building-blocks for extensions to QML.
-\section1 The QtQml Import
+\section1 Importing QtQml
-The types provided by the Qt QML module are only available in a QML document
-if that document imports the QtQml namespace (or if the document imports the
+The types provided by the \c QtQml module are only available in a QML document
+if that document imports the \c QtQml namespace (or if the document imports the
\c QtQuick namespace, as noted below).
-The current version of the import provided by the Qt QML module is version 2.0,
-and thus it may be imported via the following statement:
+The current version of the \c QtQml module is version 2.0, and thus it may be
+imported via the following statement:
\qml
import QtQml 2.0
@@ -64,7 +65,19 @@ See the \l{QtQuick}{Qt Quick} module documentation for more information about th
The documentation for the types below applies equally to the types of the same
name provided by the \l{QtQuick}{Qt Quick} module, as they are in fact identical.
-\section1 QtObject
+\section1 Basic Types
+
+The following \l{qtqml-typesystem-basictypes.html}{QML basic types} are
+provided:
+
+\annotatedlist qtqmlbasictypes
+
+\section1 Object Types
+
+The following \l{qtqml-typesystem-objecttypes.html}{QML object types} are
+provided:
+
+\section2 QtObject
The \c QtObject type provides a basic instantiable object which can be used in
QML applications. It is non-visual, but may have properties, methods, signals
@@ -89,7 +102,7 @@ the default change signal which exists for one of its properties:
}
\endcode
-\section1 Component
+\section2 Component
The \c Component type provides a basic re-usable component which allows
instances of another type to be instantiated on-demand. It may be given an
@@ -142,3 +155,172 @@ run-time:
\endcode
*/
+
+/*!
+\qmlbasictype date
+\ingroup qtqmlbasictypes
+\ingroup qtquickbasictypes
+\brief a date value.
+
+The \c date type refers to a date value.
+
+To create a \c date value, specify it as a "YYYY-MM-DD" string:
+
+\qml
+MyDatePicker { minDate: "2000-01-01"; maxDate: "2020-12-31" }
+\endqml
+
+To read a date value returned from a C++ extension class, use
+\l{QML:Qt::formatDate()}{Qt.formatDate()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+
+When integrating with C++, note that any QDate value
+\l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+converted into a \c date value, and vice-versa.
+
+Note that the date type has comparison semantics which match
+those of the JavaScript Date object. To compare the value
+of two date properties, you should compare their "toString()"
+values.
+
+This basic type is provided by the QML language.
+
+\sa {QML Basic Types}
+*/
+
+/*!
+\qmlbasictype time
+\ingroup qtqmlbasictypes
+\ingroup qtquickbasictypes
+\brief a time value.
+
+The \c time type refers to a time value.
+
+To create a \c time value, specified as "hh:mm:ss":
+
+\qml
+MyTimePicker { time: "14:22:15" }
+\endqml
+
+To read a time value returned from a C++ extension class, use
+\l{QML:Qt::formatTime()}{Qt.formatTime()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+
+Note that when converting historical times to and from javascript that QDateTime and the JS Date object
+have different methods of calculating historical daylight savings time application. This can lead to variations of one hour
+when converting to historical local time.
+
+When integrating with C++, note that any QTime value
+\l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+converted into a \c time value, and vice-versa.
+
+This basic type is provided by the QML language.
+
+\sa {QML Basic Types}
+*/
+
+/*!
+\qmlbasictype point
+\ingroup qtqmlbasictypes
+\ingroup qtquickbasictypes
+\brief a value with x and y attributes.
+
+The \c point type refers to a value with \c x and \c y attributes.
+
+To create a \c point value, specify it as a "x,y" string:
+
+\qml
+CustomObject { myPointProperty: "0,20" }
+\endqml
+
+Or use the \l{QML:Qt::point()}{Qt.point()} function:
+
+\qml
+CustomObject { myPointProperty: Qt.point(0, 20) }
+\endqml
+
+When integrating with C++, note that any QPoint or QPointF value
+\l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+converted into a \c point value. When a \c point value is passed to C++, it
+is automatically converted into a QPointF value.
+
+\sa{QML Basic Types}
+*/
+
+/*!
+\qmlbasictype size
+\ingroup qtqmlbasictypes
+\ingroup qtquickbasictypes
+\brief a value with width and height attributes
+
+The \c size type refers to a value with has \c width and \c height attributes.
+
+For example, to read the \c width and \c height values of the
+\l {Image::sourceSize} size-type property:
+
+\qml
+Column {
+ Image { id: image; source: "logo.png" }
+ Text { text: image.sourceSize.width + "," + image.sourceSize.height }
+}
+\endqml
+
+To create a \c size value, specify it as a "width x height" string:
+
+\qml
+Image { sourceSize: "150x50" }
+\endqml
+
+Or use the \l{QML:Qt::size()}{Qt.size()} function:
+
+\qml
+Image { sourceSize: Qt.size(150, 50) }
+\endqml
+
+When integrating with C++, note that any QSize or QSizeF value
+\l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+converted into a \c size value, and vice-versa. When a \c size value is passed to C++, it
+is automatically converted into a QSizeF value.
+
+\sa{QML Basic Types}
+*/
+
+/*!
+\qmlbasictype rect
+\ingroup qtqmlbasictypes
+\ingroup qtquickbasictypes
+\brief a value with x, y, width and height attributes.
+
+The \c rect type refers to a value with \c x, \c y, \c width and \c height attributes.
+
+For example, to read the \c width and \c height values of the \l Item
+\l {Item::}{childrenRect} rect-type type property:
+
+\qml
+Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
+
+ Rectangle { width: 100; height: 100 }
+}
+\endqml
+
+To create a \c rect value, specify it as a "x, y, width x height" string:
+
+\qml
+CustomObject { myRectProperty: "50,50,100x100" }
+\endqml
+
+Or use the \l{QML:Qt::rect()}{Qt.rect()} function:
+
+\qml
+CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
+\endqml
+
+When integrating with C++, note that any QRect or QRectF value
+\l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+converted into a \c rect value, and vice-versa. When a \c rect value is passed to C++, it
+is automatically converted into a QRectF value.
+
+\sa{QML Basic Types}
+*/
+
+
diff --git a/src/qml/doc/src/qtqml.qdoc b/src/qml/doc/src/qtqml.qdoc
index 8a5813fe91..4482822c01 100644
--- a/src/qml/doc/src/qtqml.qdoc
+++ b/src/qml/doc/src/qtqml.qdoc
@@ -107,14 +107,19 @@ types, animation classes, and canvas integration) for the QML language.
\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}
+ \li \l{qtqml-documents-networktransparency.html}{Resource Loading and Network Transparency}
+ \li \l{qtqml-documents-scope.html}{Scope and Naming Resolution}
\endlist
- \li \l{qtqml-typereference-topic.html}{QML Types Provided by the Qt QML Module}
+ \li \l{qtqml-typereference-topic.html}{QML Types Provided by the QtQml Module}
\list
- \li \l{qtqml-typereference-topic.html#qtobject}{QtObject}
- \li \l{qtqml-typereference-topic.html#component}{Component}
+ \li \l{qtqml-typereference-topic.html#importing-qtqml}{Importing QtQml}
+ \li \l{qtqml-typereference-topic.html#basic-types}{Basic Types}
+ \li \l{qtqml-typereference-topic.html#object-types}{Object Types}
+ \list
+ \li \l{qtqml-typereference-topic.html#qtobject}{QtObject}
+ \li \l{qtqml-typereference-topic.html#component}{Component}
+ \endlist
\endlist
\li \l{qtqml-javascript-topic.html}{Integrating QML and JavaScript}
diff --git a/src/qml/doc/src/typesystem/basictypes.qdoc b/src/qml/doc/src/typesystem/basictypes.qdoc
index 176a56a3cf..0f66112b3c 100644
--- a/src/qml/doc/src/typesystem/basictypes.qdoc
+++ b/src/qml/doc/src/typesystem/basictypes.qdoc
@@ -49,14 +49,31 @@ Basic types can be used to refer to:
\section1 Supported Basic Types
-Most basic types are supported by the engine by default and do not require an
-\l {Import Statements}{Import Statement} to be used, unlike QML object types.
-Some basic types which contain multiple property-value pairs (also known as \c{value types})
-do require an import, as they are provided by the QtQuick module.
-The basic types supported in QML are listed below:
+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 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
@@ -289,311 +306,6 @@ property is only invoked when the property is reassigned to a different object v
\sa {QML Basic Types}
*/
-/*!
- \qmlbasictype color
- \ingroup qmlbasictypes
- \brief an ARGB color value.
- \target qmlbasictypecolor
-
- The \c color type refers to an ARGB color value. It can be specified in a number of ways:
-
- \list
- \li By a \l{http://www.w3.org/TR/SVG/types.html#ColorKeywords}{SVG color name}, such as
- "red", "green" or "lightsteelblue".
- \li By a hexadecimal triplet or quad in the form \c "#RRGGBB" and \c "#AARRGGBB"
- respectively. For example, the color red corresponds to a triplet of \c "#FF0000"
- and a slightly transparent blue to a quad of \c "#800000FF".
- \li Using the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()},
- \l{QML:Qt::darker()}{Qt.darker()}, \l{QML:Qt::lighter()}{Qt.lighter()} or
- \l{QML:Qt::tint()}{Qt.tint()} functions.
- \endlist
-
- Example:
-
- \div{float-right}
- \inlineimage declarative-colors.png
- \enddiv
- \snippet qml/colors.qml colors
-
- Additionally, a color type has \c r, \c g, \c b and \c a properties that refer to the
- red, green, blue and alpha values of the color, respectively:
-
- \qml
- Text {
- color: "red"
-
- // prints "1 0 0 1"
- Component.onCompleted: console.log(color.r, color.g, color.b, color.a)
- }
- \endqml
-
- To test color values for equality, use the \l{QML:Qt::colorEqual()}{Qt.colorEqual()}
- function. This allows colors to be accurately compared whether they are in property
- form or in any of the acceptable string specification forms.
-
- When integrating with C++, note that any QColor value
- \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
- converted into a \c color value, and vice-versa.
-
- This basic type is provided by the QtQuick import.
-
- \sa {QML Basic Types}
-*/
-
-/*!
- \qmlbasictype point
- \ingroup qmlbasictypes
- \brief a value with x and y attributes.
-
- The \c point type refers to a value with \c x and \c y attributes.
-
- To create a \c point value, specify it as a "x,y" string:
-
- \qml
- CustomObject { myPointProperty: "0,20" }
- \endqml
-
- Or use the \l{QML:Qt::point()}{Qt.point()} function:
-
- \qml
- CustomObject { myPointProperty: Qt.point(0, 20) }
- \endqml
-
- When integrating with C++, note that any QPoint or QPointF value
- \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
- converted into a \c point value. When a \c point value is passed to C++, it
- is automatically converted into a QPointF value.
-
- This basic type is provided by the QML language.
-
- \sa {QML Basic Types}
-*/
-
-/*!
- \qmlbasictype size
- \ingroup qmlbasictypes
- \brief a value with width and height attributes
-
- The \c size type refers to a value with has \c width and \c height attributes.
-
- For example, to read the \c width and \c height values of the
- \l {Image::sourceSize} size-type property:
-
- \qml
- Column {
- Image { id: image; source: "logo.png" }
- Text { text: image.sourceSize.width + "," + image.sourceSize.height }
- }
- \endqml
-
- To create a \c size value, specify it as a "width x height" string:
-
- \qml
- Image { sourceSize: "150x50" }
- \endqml
-
- Or use the \l{QML:Qt::size()}{Qt.size()} function:
-
- \qml
- Image { sourceSize: Qt.size(150, 50) }
- \endqml
-
- When integrating with C++, note that any QSize or QSizeF value
- \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
- converted into a \c size value, and vice-versa. When a \c size value is passed to C++, it
- is automatically converted into a QSizeF value.
-
- This basic type is provided by the QML language.
-
- \sa {QML Basic Types}
-*/
-
-/*!
- \qmlbasictype rect
- \ingroup qmlbasictypes
- \brief a value with x, y, width and height attributes.
-
- The \c rect type refers to a value with \c x, \c y, \c width and \c height attributes.
-
- For example, to read the \c width and \c height values of the \l Item
- \l {Item::}{childrenRect} rect-type type property:
-
- \qml
- Rectangle {
- width: childrenRect.width
- height: childrenRect.height
-
- Rectangle { width: 100; height: 100 }
- }
- \endqml
-
- To create a \c rect value, specify it as a "x, y, width x height" string:
-
- \qml
- CustomObject { myRectProperty: "50,50,100x100" }
- \endqml
-
- Or use the \l{QML:Qt::rect()}{Qt.rect()} function:
-
- \qml
- CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
- \endqml
-
- When integrating with C++, note that any QRect or QRectF value
- \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
- converted into a \c rect value, and vice-versa. When a \c rect value is passed to C++, it
- is automatically converted into a QRectF value.
-
- This basic type is provided by the QML language.
-
- \sa {QML Basic Types}
-*/
-
-/*!
- \qmlbasictype date
- \ingroup qmlbasictypes
- \brief a date value.
-
- The \c date type refers to a date value.
-
- To create a \c date value, specify it as a "YYYY-MM-DD" string:
-
- \qml
- MyDatePicker { minDate: "2000-01-01"; maxDate: "2020-12-31" }
- \endqml
-
- To read a date value returned from a C++ extension class, use
- \l{QML:Qt::formatDate()}{Qt.formatDate()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
-
- When integrating with C++, note that any QDate value
- \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
- converted into a \c date value, and vice-versa.
-
- Note that the date type has comparison semantics which match
- those of the JavaScript Date object. To compare the value
- of two date properties, you should compare their "toString()"
- values.
-
- This basic type is provided by the QML language.
-
- \sa {QML Basic Types}
-*/
-
-/*!
- \qmlbasictype time
- \ingroup qmlbasictypes
- \brief a time value.
-
- The \c time type refers to a time value.
-
- To create a \c time value, specified as "hh:mm:ss":
-
- \qml
- MyTimePicker { time: "14:22:15" }
- \endqml
-
- To read a time value returned from a C++ extension class, use
- \l{QML:Qt::formatTime()}{Qt.formatTime()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
-
- Note that when converting historical times to and from javascript that QDateTime and the JS Date object
- have different methods of calculating historical daylight savings time application. This can lead to variations of one hour
- when converting to historical local time.
-
- When integrating with C++, note that any QTime value
- \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
- converted into a \c time value, and vice-versa.
-
- This basic type is provided by the QML language.
-
- \sa {QML Basic Types}
- */
-
-/*!
- \qmlbasictype font
- \ingroup qmlbasictypes
- \brief a font value with the properties of QFont.
- \target fontbasictypedocs
-
- The \c font type refers to a font value with the properties of QFont.
-
- The most commonly used properties are:
-
- \list
- \li \l string \c font.family
- \li \l bool \c font.bold
- \li \l bool \c font.italic
- \li \l bool \c font.underline
- \li \l real \c font.pointSize
- \li \l int \c font.pixelSize
- \endlist
-
- If both \c pointSize and a \c pixelSize are specified, \c pixelSize will be used.
-
- The following properties are also available:
-
- \list
- \li \l enumeration \c font.weight
- \li \l bool \c font.overline
- \li \l bool \c font.strikeout
- \li \l enumeration \c font.capitalization
- \li \l real \c font.letterSpacing
- \li \l real \c font.wordSpacing
- \endlist
-
- Example:
- \qml
- Text { font.family: "Helvetica"; font.pointSize: 13; font.bold: true }
- \endqml
-
- When integrating with C++, note that any QFont value
- \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
- converted into a \c font value, and vice-versa.
-
- This basic type is provided by the QtQuick import.
-
- Font weighting is classified on a scale from 0 to 99, where a weight of 0 is ultralight,
- and 99 is extremely black. The following values are supported:
-
- \table
- \row
- \li \c Font.Light
- \li 25
- \row
- \li \c Font.Normal
- \li 50
- \row
- \li \c Font.DemiBold
- \li 63
- \row
- \li \c Font.Bold
- \li 75
- \row
- \li \c Font.Black
- \li 87
- \endtable
-
- Capitalization supports the following values:
-
- \table
- \row
- \li \c Font.MixedCase
- \li No capitalization change is applied.
- \row
- \li \c Font.AllUppercase
- \li Alters the text to be rendered in all uppercase type.
- \row
- \li \c Font.AllLowercase
- \li Alters the text to be rendered in all lowercase type.
- \row
- \li \c Font.SmallCaps
- \li Alters the text to be rendered in small-caps type.
- \row
- \li \c Font.Capitalize
- \li Alters the text to be rendered with the first character of each word as an uppercase character.
- \endtable
-
- \sa {QML Basic Types}
-*/
/*!
\qmlbasictype list
@@ -906,112 +618,6 @@ property is only invoked when the property is reassigned to a different object v
*/
/*!
- \qmlbasictype vector2d
- \ingroup qmlbasictypes
-
- \brief A vector2d type has x and y attributes.
-
- A \c vector2d type has \c x and \c y attributes, otherwise
- it is similar to the \c vector3d type. Please see the
- documentation about the \c vector3d type for more information.
-
- To create a \c vector2d value, specify it as a "x,y" string,
- or define the components individually, or compose it with
- the Qt.vector2d() function.
-
- This basic type is provided by the QtQuick import.
-
- \sa {QML Basic Types}
-*/
-
-/*!
- \qmlbasictype vector3d
- \ingroup qmlbasictypes
- \brief a value with x, y, and z attributes.
-
- The \c vector3d type refers to a value with \c x, \c y, and \c z attributes.
-
- To create a \c vector3d value, specify it as a "x,y,z" string:
-
- \qml
- Rotation { angle: 60; axis: "0,1,0" }
- \endqml
-
- or with the \l{QML:Qt::vector3d()}{Qt.vector3d()} function:
-
- \qml
- Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }
- \endqml
-
- or as separate \c x, \c y, and \c z components:
-
- \qml
- Rotation { angle: 60; axis.x: 0; axis.y: 1; axis.z: 0 }
- \endqml
-
- When integrating with C++, note that any QVector3D value
- \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
- converted into a \c vector3d value, and vice-versa.
-
- This basic type is provided by the QtQuick import.
-
- \sa {QML Basic Types}
-*/
-
-/*!
- \qmlbasictype vector4d
- \ingroup qmlbasictypes
-
- \brief A vector4d type has x, y, z and w attributes.
-
- A \c vector4d type has \c x, \c y, \c z and \c w attributes,
- otherwise it is similar to the \c vector3d type. Please see the
- documentation about the \c vector3d type for more information.
-
- To create a \c vector4d value, specify it as a "x,y,z,w" string,
- or define the components individually, or compose it with
- the Qt.vector4d() function.
-
- This basic type is provided by the QtQuick import.
-
- \sa {QML Basic Types}
-*/
-
-/*!
- \qmlbasictype quaternion
- \ingroup qmlbasictypes
-
- \brief A quaternion type has scalar, x, y, and z attributes.
-
- A \c quaternion type has \c scalar, \c x, \c y and \c z attributes,
- otherwise it is similar to the \c vector3d type. Please see the
- documentation about the \c vector3d type for more information.
-
- To create a \c quaternion value, specify it as a "scalar,x,y,z" string,
- or define the components individually, or compose it with
- the Qt.quaternion() function.
-
- This basic type is provided by the QtQuick import.
-
- \sa {QML Basic Types}
-*/
-
-/*!
- \qmlbasictype matrix4x4
- \ingroup qmlbasictypes
-
- \brief A matrix4x4 type is a 4-row and 4-column matrix
-
- A \c matrix4x4 type has sixteen values, but these values are
- largely opaque to QML. Values of this type can be composed with
- the Qt.matrix4x4() function.
-
- This basic type is provided by the QtQuick import.
-
- \sa {QML Basic Types}
-*/
-
-/*!
\qmlbasictype enumeration
\ingroup qmlbasictypes
\brief a named enumeration value.
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index b99d35029a..ef1f3ea597 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -449,7 +449,7 @@ v8::Handle<v8::Value> hsla(const v8::Arguments &args)
Returns true if both \c lhs and \c rhs yield equal color values. Both arguments
may be either color values or string values. If a string value is supplied it
-must be convertible to a color, as described for the \l{qmlbasictypecolor}{color}
+must be convertible to a color, as described for the \l{colorbasictypedocs}{color}
basic type.
*/
v8::Handle<v8::Value> colorEqual(const v8::Arguments &args)
diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc
index e58626b85a..6920fffb71 100644
--- a/src/quick/doc/src/qmltypereference.qdoc
+++ b/src/quick/doc/src/qmltypereference.qdoc
@@ -31,12 +31,41 @@
\brief Description of the QML types provided by the Qt Quick module
This page contains links to documentation for every QML type provided by the
-Qt Quick module, organized according to category and purpose. All of the types
-are based on the basic \l{Item} type, which itself derives from \l{QML::QtObject}.
-Basic QML types such as \l{QML::QtObject} and \l{QML::Component} are also available
-when you import QtQuick.
+\c QtQuick QML module, organized according to category and purpose.
-\section1 Visual Types
+\section1 Importing QtQuick
+
+The types provided by the QtQuick module are only available in a QML document
+if that document imports the \c QtQuick namespace.
+
+The current version of the QtQuick module is version 2.0, and thus it may be
+imported via the following statement:
+
+\qml
+import QtQuick 2.0
+\endqml
+
+See the \l{qtquick-main.html}{Qt Quick} module documentation for more
+information about the concepts which are central to \c QtQuick.
+
+\section1 Basic Types
+
+There are a number of basic types that are
+\l{qtqml-typesystem-basictypes.html#basic-types-provided-by-the-qml-language}
+{supported by default in the QML language}.
+
+In addition, the QtQuick module provides the following basic types:
+\annotatedlist qtquickbasictypes
+
+\section1 Object Types
+
+All of the object types provided by QtQuick are based on the \l{Item} type,
+which itself derives from \l{QML::QtObject}. QML object types provided by
+the \l{qtqml-typereference-topic.html#object-types}{QtQml module}
+(such as \l{QML::QtObject} and \l{QML::Component}) are also available when
+you import QtQuick.
+
+\section2 Visual Types
\list
\li \l {Item} - Basic visual object type inherited by visual object types (visual items)
@@ -77,7 +106,7 @@ Visual Item Transformations
\endlist
-\section1 User Input
+\section2 User Input
\list
\li \l {MouseArea} - Sets up an area for mouse interaction
@@ -111,7 +140,7 @@ User Input Events
\li \l {DragEvent} -Provides information about a drag event
\endlist
-\section1 Positioning
+\section2 Positioning
\list
\li \l {Positioner} - Attached property which provides information about where an Item has been positioned
@@ -122,7 +151,7 @@ User Input Events
\li \l {LayoutMirroring} - Attached property used to mirror layout behavior
\endlist
-\section1 States, Transitions and Animations
+\section2 States, Transitions and Animations
States
\list
@@ -179,7 +208,7 @@ Animation paths
\li \l {PathPercent} - Modifies the item distribution along a \l {Path}
\endlist
-\section1 Model/View Types And Data Storage And Access
+\section2 Model/View Types And Data Storage And Access
Models And Model Data
\list
@@ -205,7 +234,7 @@ Data Storage
\li \l {LocalStorage} - Module API providing simplified SQL access
\endlist
-\section1 Graphical Effects
+\section2 Graphical Effects
\list
\li \l {Flipable} - Provides a surface that produces "flipping" effects
@@ -215,7 +244,7 @@ Data Storage
\li The \l{QtQuick.Particles 2} module provides a set of Particle System types for QtQuick 2
\endlist
-\section1 Convenience Types
+\section2 Convenience Types
\list
\li \l {Connections} - Explicitly connects signals and signal handlers
@@ -224,7 +253,7 @@ Data Storage
\li \l {WorkerScript} - Enables the use of threads in a Qt Quick application
\endlist
-\section1 Canvas (similar to HTML5 canvas)
+\section2 Canvas (similar to HTML5 canvas)
\list
\li \l {Canvas} - Provides a 2D canvas type similar to the HTML5 canvas
@@ -236,3 +265,247 @@ Data Storage
\endlist
*/
+
+/*!
+ \qmlbasictype color
+ \ingroup qtquickbasictypes
+ \brief an ARGB color value.
+ \target colorbasictypedocs
+
+ The \c color type refers to an ARGB color value. It can be specified in a number of ways:
+
+ \list
+ \li By a \l{http://www.w3.org/TR/SVG/types.html#ColorKeywords}{SVG color name}, such as
+ "red", "green" or "lightsteelblue".
+ \li By a hexadecimal triplet or quad in the form \c "#RRGGBB" and \c "#AARRGGBB"
+ respectively. For example, the color red corresponds to a triplet of \c "#FF0000"
+ and a slightly transparent blue to a quad of \c "#800000FF".
+ \li Using the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()},
+ \l{QML:Qt::darker()}{Qt.darker()}, \l{QML:Qt::lighter()}{Qt.lighter()} or
+ \l{QML:Qt::tint()}{Qt.tint()} functions.
+ \endlist
+
+ Example:
+
+ \div{float-right}
+ \inlineimage declarative-colors.png
+ \enddiv
+ \snippet qml/colors.qml colors
+
+ Additionally, a color type has \c r, \c g, \c b and \c a properties that refer to the
+ red, green, blue and alpha values of the color, respectively:
+
+ \qml
+ Text {
+ color: "red"
+
+ // prints "1 0 0 1"
+ Component.onCompleted: console.log(color.r, color.g, color.b, color.a)
+ }
+ \endqml
+
+ To test color values for equality, use the \l{QML:Qt::colorEqual()}{Qt.colorEqual()}
+ function. This allows colors to be accurately compared whether they are in property
+ form or in any of the acceptable string specification forms.
+
+ When integrating with C++, note that any QColor value
+ \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+ converted into a \c color value, and vice-versa.
+
+ This basic type is provided by the QtQuick import.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype font
+ \ingroup qtquickbasictypes
+ \brief a font value with the properties of QFont.
+ \target fontbasictypedocs
+
+ The \c font type refers to a font value with the properties of QFont.
+
+ The most commonly used properties are:
+
+ \list
+ \li \l string \c font.family
+ \li \l bool \c font.bold
+ \li \l bool \c font.italic
+ \li \l bool \c font.underline
+ \li \l real \c font.pointSize
+ \li \l int \c font.pixelSize
+ \endlist
+
+ If both \c pointSize and a \c pixelSize are specified, \c pixelSize will be used.
+
+ The following properties are also available:
+
+ \list
+ \li \l enumeration \c font.weight
+ \li \l bool \c font.overline
+ \li \l bool \c font.strikeout
+ \li \l enumeration \c font.capitalization
+ \li \l real \c font.letterSpacing
+ \li \l real \c font.wordSpacing
+ \endlist
+
+ Example:
+ \qml
+ Text { font.family: "Helvetica"; font.pointSize: 13; font.bold: true }
+ \endqml
+
+ When integrating with C++, note that any QFont value
+ \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+ converted into a \c font value, and vice-versa.
+
+ This basic type is provided by the QtQuick import.
+
+ Font weighting is classified on a scale from 0 to 99, where a weight of 0 is ultralight,
+ and 99 is extremely black. The following values are supported:
+
+ \table
+ \row
+ \li \c Font.Light
+ \li 25
+ \row
+ \li \c Font.Normal
+ \li 50
+ \row
+ \li \c Font.DemiBold
+ \li 63
+ \row
+ \li \c Font.Bold
+ \li 75
+ \row
+ \li \c Font.Black
+ \li 87
+ \endtable
+
+ Capitalization supports the following values:
+
+ \table
+ \row
+ \li \c Font.MixedCase
+ \li No capitalization change is applied.
+ \row
+ \li \c Font.AllUppercase
+ \li Alters the text to be rendered in all uppercase type.
+ \row
+ \li \c Font.AllLowercase
+ \li Alters the text to be rendered in all lowercase type.
+ \row
+ \li \c Font.SmallCaps
+ \li Alters the text to be rendered in small-caps type.
+ \row
+ \li \c Font.Capitalize
+ \li Alters the text to be rendered with the first character of each word as an uppercase character.
+ \endtable
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype vector2d
+ \ingroup qtquickbasictypes
+
+ \brief A vector2d type has x and y attributes.
+
+ A \c vector2d type has \c x and \c y attributes, otherwise
+ it is similar to the \c vector3d type. Please see the
+ documentation about the \c vector3d type for more information.
+
+ To create a \c vector2d value, specify it as a "x,y" string,
+ or define the components individually, or compose it with
+ the Qt.vector2d() function.
+
+ This basic type is provided by the QtQuick import.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype vector3d
+ \ingroup qtquickbasictypes
+ \brief a value with x, y, and z attributes.
+
+ The \c vector3d type refers to a value with \c x, \c y, and \c z attributes.
+
+ To create a \c vector3d value, specify it as a "x,y,z" string:
+
+ \qml
+ Rotation { angle: 60; axis: "0,1,0" }
+ \endqml
+
+ or with the \l{QML:Qt::vector3d()}{Qt.vector3d()} function:
+
+ \qml
+ Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }
+ \endqml
+
+ or as separate \c x, \c y, and \c z components:
+
+ \qml
+ Rotation { angle: 60; axis.x: 0; axis.y: 1; axis.z: 0 }
+ \endqml
+
+ When integrating with C++, note that any QVector3D value
+ \l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
+ converted into a \c vector3d value, and vice-versa.
+
+ This basic type is provided by the QtQuick import.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype vector4d
+ \ingroup qtquickbasictypes
+
+ \brief A vector4d type has x, y, z and w attributes.
+
+ A \c vector4d type has \c x, \c y, \c z and \c w attributes,
+ otherwise it is similar to the \c vector3d type. Please see the
+ documentation about the \c vector3d type for more information.
+
+ To create a \c vector4d value, specify it as a "x,y,z,w" string,
+ or define the components individually, or compose it with
+ the Qt.vector4d() function.
+
+ This basic type is provided by the QtQuick import.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype quaternion
+ \ingroup qtquickbasictypes
+
+ \brief A quaternion type has scalar, x, y, and z attributes.
+
+ A \c quaternion type has \c scalar, \c x, \c y and \c z attributes,
+ otherwise it is similar to the \c vector3d type. Please see the
+ documentation about the \c vector3d type for more information.
+
+ To create a \c quaternion value, specify it as a "scalar,x,y,z" string,
+ or define the components individually, or compose it with
+ the Qt.quaternion() function.
+
+ This basic type is provided by the QtQuick import.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype matrix4x4
+ \ingroup qtquickbasictypes
+
+ \brief A matrix4x4 type is a 4-row and 4-column matrix
+
+ A \c matrix4x4 type has sixteen values, but these values are
+ largely opaque to QML. Values of this type can be composed with
+ the Qt.matrix4x4() function.
+
+ This basic type is provided by the QtQuick import.
+
+ \sa {QML Basic Types}
+*/
diff --git a/src/quick/doc/src/qtquick.qdoc b/src/quick/doc/src/qtquick.qdoc
index a5900caa1e..8fa21cee53 100644
--- a/src/quick/doc/src/qtquick.qdoc
+++ b/src/quick/doc/src/qtquick.qdoc
@@ -73,16 +73,21 @@ To find out more about using the QML language, see the \l{Qt QML Module Document
\list
- \li \l{qtquick-qmltypereference.html}{QML Types provided by the Qt Quick Module}
+ \li \l{qtquick-qmltypereference.html}{QML Types provided by the QtQuick Module}
\list
- \li \l{qtquick-qmltypereference.html#visual-types}{Visual Types}
- \li \l{qtquick-qmltypereference.html#user-input-types}{User Input Types}
- \li \l{qtquick-qmltypereference.html#positioning}{Positioning}
- \li \l{qtquick-qmltypereference.html#states-transitions-and-animations}{States, Transitions And Animations}
- \li \l{qtquick-qmltypereference.html#model-view-types-and-data-storage-and-access}{Model/View Types And Data Storage And Access}
- \li \l{qtquick-qmltypereference.html#particles-and-graphical-effects}{Particles And Graphical Effects}
- \li \l{qtquick-qmltypereference.html#convenience-types}{Convenience Types}
- \li \l{qtquick-qmltypereference.html#canvas-similar-to-html5-canvas}{Canvas (similar to HTML5 Canvas)}
+ \li \l{qtquick-qmltypereference.html#importing-qtquick}{Importing QtQuick}
+ \li \l{qtquick-qmltypereference.html#basic-types}{Basic Types}
+ \li \l{qtquick-qmltypereference.html#object-types}{Object Types}
+ \list
+ \li \l{qtquick-qmltypereference.html#visual-types}{Visual Types}
+ \li \l{qtquick-qmltypereference.html#user-input-types}{User Input Types}
+ \li \l{qtquick-qmltypereference.html#positioning}{Positioning}
+ \li \l{qtquick-qmltypereference.html#states-transitions-and-animations}{States, Transitions And Animations}
+ \li \l{qtquick-qmltypereference.html#model-view-types-and-data-storage-and-access}{Model/View Types And Data Storage And Access}
+ \li \l{qtquick-qmltypereference.html#particles-and-graphical-effects}{Particles And Graphical Effects}
+ \li \l{qtquick-qmltypereference.html#convenience-types}{Convenience Types}
+ \li \l{qtquick-qmltypereference.html#canvas-similar-to-html5-canvas}{Canvas (similar to HTML5 Canvas)}
+ \endlist
\endlist
\li \l{qtquick-cppextensionpoints.html}{C++ Extension Points}