summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-05-05 05:27:57 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-05-05 05:27:57 (GMT)
commit066f18d1830c5820041c3b267db404be8bc68a32 (patch)
treeffc588a4e4a5fc8e97f1726761d2e4ea447ef302 /src
parentc376633cba5c79ed1d842d9c6b7b68e31c646959 (diff)
downloadQt-066f18d1830c5820041c3b267db404be8bc68a32.zip
Qt-066f18d1830c5820041c3b267db404be8bc68a32.tar.gz
Qt-066f18d1830c5820041c3b267db404be8bc68a32.tar.bz2
Content/ContentWrapper documentation.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/fx/qfxcontentwrapper.cpp66
1 files changed, 35 insertions, 31 deletions
diff --git a/src/declarative/fx/qfxcontentwrapper.cpp b/src/declarative/fx/qfxcontentwrapper.cpp
index 2b95ff6..c118569 100644
--- a/src/declarative/fx/qfxcontentwrapper.cpp
+++ b/src/declarative/fx/qfxcontentwrapper.cpp
@@ -46,6 +46,16 @@
QT_BEGIN_NAMESPACE
QML_DEFINE_TYPE(QFxContentWrapper,ContentWrapper);
+/*!
+ \qmlclass ContentWrapper QFxContentWrapper
+ \ingroup group_utility
+ \brief ContentWrapper provides a component which contains content.
+ \inherits Item
+
+ The ContentWrapper element is used to place content within a component.
+ See \l Content for usage.
+*/
+
QFxContentWrapper::QFxContentWrapper(QFxItem *parent)
: QFxItem(*(new QFxContentWrapperPrivate), parent)
{
@@ -56,6 +66,14 @@ QFxContentWrapper::QFxContentWrapper(QFxContentWrapperPrivate &dd, QFxItem *pare
{
}
+/*!
+ \qmlproperty list<Item> QFxContentWrapper::content
+
+ Contains the list of elements to replace the \l Content
+ placeholder.
+
+ \sa Content
+*/
QList<QFxItem *> *QFxContentWrapper::content()
{
Q_D(QFxContentWrapper);
@@ -101,38 +119,24 @@ QML_DEFINE_TYPE(QFxContent,Content);
In some cases the content of a component is not defined by the component itself.
For example, the items placed in a group box need to be specified external to
- the where the group box component itself is defined.
+ group box component definition itself.
In cases like these Content can be used to specify at what location in the component
- the content should be placed. It is used in conjuntion with the content property of
- the component instance: any items listed as content will be placed in the location
- specified by Content.
-
- Example:
- \qml
-// GroupBox component definition
-Rect {
- width: parent.width
- color: "white"
- pen.width: 2
- pen.color: "#adaeb0"
- radius: 10
- clip: false
- height: contents.height
- VerticalLayout {
- id: layout
- width: parent.width
- Content { } // content property will go here
- }
-}
-
-// component use
-GroupBox {
- content: Text {
- text: "First Item"
- ...
- }
-}
- \endqml
+ the content should be placed. It is used in conjuntion with the \e content property of
+ the ContentWrapper element: any items listed as content will be placed in the location
+ specified by Content. The component containing the Content must be of type
+ ContentWrapper.
+
+ GroupBox component definition:
+ \quotefile doc/src/snippets/declarative/GroupBox.qml
+
+ \bold Note that in the above component definition ContentWrapper's \e children
+ property is specified explicitly since \e content is the default property.
+
+ Component use:
+ \table
+ \row \o \image content.png
+ \o \quotefile doc/src/snippets/declarative/content.qml
+ \endtable
*/
QT_END_NAMESPACE