diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-07-06 05:30:33 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-07-06 05:30:33 (GMT) |
commit | c9d487b6ed3ac9bb666c2a1fe08252f3c6dcb455 (patch) | |
tree | 68ca42e8c1bbfcf99e6db77be213688d437feeba /doc | |
parent | 6b2ec2ab8df94233d6ba7960d5bfb3c7461b76ec (diff) | |
download | Qt-c9d487b6ed3ac9bb666c2a1fe08252f3c6dcb455.zip Qt-c9d487b6ed3ac9bb666c2a1fe08252f3c6dcb455.tar.gz Qt-c9d487b6ed3ac9bb666c2a1fe08252f3c6dcb455.tar.bz2 |
doc improvements
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/declarative/extending.qdoc | 38 | ||||
-rw-r--r-- | doc/src/examples/qml-examples.qdoc | 7 |
2 files changed, 40 insertions, 5 deletions
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index 6476dfb..1ee3574 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -684,10 +684,6 @@ of some of the types. For the remaining types the default values are undefined. \row \o color \o #000000 (black) \endtable -If specified, the optional "default" attribute marks the new property as the -types default property, overriding any existing default property. Using the -default attribute twice in the same type block is an error. - The following example shows how to declare a new "innerColor" property that controls the color of the inner rectangle. @@ -705,6 +701,40 @@ controls the color of the inner rectangle. } \endcode + +\section3 Setting default properties + +The optional "default" attribute marks a property as the \e {default property} +for a type. This allows other items to specify the default property's value +as child elements. For example, the \l Item element's default property is its +\l{Item::children}{children} property. This allows the children of an \l Item +to be set like this: + +\qml +Item { + Rectangle {} + Rectangle {} +} +\endqml + +If the \l{Item::children}{children} property was not the default property for +\l Item, its value would have to be set like this instead: + +\qml +Item { + children: [ + Rectangle {} + Rectangle {} + ] +} +\endqml + +Specifying a default property overrides any existing default property (for +example, any default property inherited from a parent item). Using the +default attribute twice in the same type block is an error. + + + \target qml-property-aliases \section2 Property aliases diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc index c8a7403..dec5441 100644 --- a/doc/src/examples/qml-examples.qdoc +++ b/doc/src/examples/qml-examples.qdoc @@ -196,6 +196,9 @@ \o \l{declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout}{QGraphicsGridLayout} \o \l{declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout}{QGraphicsLinearLayout} \endlist + + Also see \l {Integrating QML with existing Qt UI code} for information on using QML + in Qt applications that use the Graphics View framework or ordinary QWidget-based views. */ /*! @@ -608,7 +611,9 @@ \title UI Components: Tab Widget \example declarative/ui-components/tabwidget - This example shows how to create a tab widget. + This example shows how to create a tab widget. It also demonstrates how + \l {Setting default properties}{default properties} can be used to collect and + assemble the child items declared within an \l Item. \image qml-tabwidget-example.png */ |