Update usage of childrenRect in Flickable docs.
authorMichael Brasser <michael.brasser@nokia.com>
Mon, 9 Jul 2012 01:01:48 +0000 (11:01 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 11 Jul 2012 01:00:00 +0000 (03:00 +0200)
The childrenRect of the Flickable itself is rarely what is wanted when
setting the contentWidth and contentHeight.

Change-Id: Ica13a0955869157957b9d3b5917c634ea9c51e30
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/items/qquickflickable.cpp

index 5a21b07..750f7d9 100644 (file)
@@ -1682,9 +1682,16 @@ void QQuickFlickable::setRebound(QQuickTransition *transition)
 
     \snippet qml/flickable.qml document
 
-    In some cases, the the content dimensions can be automatically set
-    using the \l {Item::childrenRect.width}{childrenRect.width}
-    and \l {Item::childrenRect.height}{childrenRect.height} properties.
+    In some cases, the content dimensions can be automatically set
+    based on the \l {Item::childrenRect.width}{childrenRect.width}
+    and \l {Item::childrenRect.height}{childrenRect.height} properties
+    of the \l contentItem. For example, the previous snippet could be rewritten with:
+
+    \qml
+    contentWidth: contentItem.childrenRect.width; contentHeight: contentItem.childrenRect.height
+    \endqml
+
+    Though this assumes that the origin of the childrenRect is 0,0.
 */
 qreal QQuickFlickable::contentWidth() const
 {