From abe97ed9363ec5d3099ae388c12fb17d3bed3e3c Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 9 Jul 2012 11:01:48 +1000 Subject: [PATCH] Update usage of childrenRect in Flickable docs. The childrenRect of the Flickable itself is rarely what is wanted when setting the contentWidth and contentHeight. Change-Id: Ica13a0955869157957b9d3b5917c634ea9c51e30 Reviewed-by: Martin Jones --- src/quick/items/qquickflickable.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 5a21b07..750f7d9 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -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 { -- 2.7.4