aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2012-08-02 10:58:07 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-02 05:44:41 +0200
commitd92c9490f9ba24ca703d02ecf3ce75006cca8fdf (patch)
tree4be29498747ca96bd51d5e66fe7765858b2a89ef /src/qml/doc
parentf08f626d57f269ab5196cb863a5be59096b580b5 (diff)
Update docs now that all basic types can also be property types
Change-Id: I9f90627dc3f83e64e6d1d7b2937fdf5653a063f3 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/doc')
-rw-r--r--src/qml/doc/src/syntax/objectattributes.qdoc50
1 files changed, 18 insertions, 32 deletions
diff --git a/src/qml/doc/src/syntax/objectattributes.qdoc b/src/qml/doc/src/syntax/objectattributes.qdoc
index 741b7cbb91..fa84b79c04 100644
--- a/src/qml/doc/src/syntax/objectattributes.qdoc
+++ b/src/qml/doc/src/syntax/objectattributes.qdoc
@@ -146,18 +146,26 @@ Rectangle {
\section4 Valid Types in Custom Property Definitions
-The following types can be used as custom property types:
+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:
-\list
-\li \l bool
-\li \l int
-\li \l real, \l double
-\li \l string
-\li \l var
-\endlist
+\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.)
-The \l var type is a generic placeholder type that can hold any type of value,
-including lists and objects:
+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
@@ -167,28 +175,6 @@ property var someList: [1, 2, "three", "four"]
property var someObject: Rectangle { width: 100; height: 100; color: "red" }
\endcode
-For convenience, the following types can also be used as custom property types.
-Using these types specifically instead of the \l var type provides type safety
-and may also assist with application optimization:
-
-\list
-\li \l color
-\li \l font
-\li \l date
-\li \l url
-\li \l rect
-\li \l point
-\li \l size
-\li \l vector2d
-\li \l vector3d
-\li \l vector4d
-\li \l quaternion
-\li \l matrix4x4
-\endlist
-
-\note Some of the above types are only available if the Qt Quick module has
-been imported by the application.
-
Additionally, any \l{QML Object Types}{QML object type} can be used as a
property type. For example: