diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-07-07 04:12:19 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-07-07 04:12:19 (GMT) |
commit | b4b1b118015d1dcef63b065a609234a18f332ba4 (patch) | |
tree | 3ed0cd064a056e02b44dbc2b0f9df92c09359d39 /doc | |
parent | 628159323c60c434a202b036ecbaf5e433c703e8 (diff) | |
parent | e3bc34b40559e0cb88363039ee61300478e7c700 (diff) | |
download | Qt-b4b1b118015d1dcef63b065a609234a18f332ba4.zip Qt-b4b1b118015d1dcef63b065a609234a18f332ba4.tar.gz Qt-b4b1b118015d1dcef63b065a609234a18f332ba4.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/declarative/extending.qdoc | 43 | ||||
-rw-r--r-- | doc/src/examples/qml-examples.qdoc | 7 |
2 files changed, 45 insertions, 5 deletions
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index 28d4ed4..3b04ddb 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -712,10 +712,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. @@ -733,6 +729,9 @@ controls the color of the inner rectangle. } \endcode + +\section3 Property signal handlers + Adding a property to an item automatically adds a \e{value-changed} signal handler to the item. The signal hander is named \c{on<Property_name>Changed}, with the first letter of the property @@ -751,6 +750,42 @@ example shows how to output to a text console a new value of property } \endcode + +\section3 Setting default properties + +The optional \c default attribute for a property marks it 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 + +See the \l{declarative/ui-components/tabwidget}{TabWidget} example for a +demonstration of using default properties. + +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 */ |