From 614d16d6f0e5e125b5572c4cd2bfe447f939a9b2 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 11 Oct 2018 10:02:59 +0200 Subject: Doc: place more importance on not binding to x/y/width/height It's common for users to bind to these properties and think that it's a bug that it doesn't work, so we should make the note in the docs more strongly worded and elaborate a bit. Change-Id: I82c8d5644ed81cc616a3035f489344a491ea5a66 Reviewed-by: Andy Shaw Reviewed-by: Venugopal Shivashankar --- src/imports/layouts/qquicklayout.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/imports/layouts/qquicklayout.cpp b/src/imports/layouts/qquicklayout.cpp index cc206bcb95..d90eae5f80 100644 --- a/src/imports/layouts/qquicklayout.cpp +++ b/src/imports/layouts/qquicklayout.cpp @@ -74,10 +74,14 @@ false, the item's size will be fixed to its preferred size. Otherwise, it will grow or shrink between its minimum and maximum size as the layout is resized. - \note It is not recommended to have bindings to the x, y, width, or height properties of items - in a layout, since this would conflict with the goals of Layout, and can also cause binding - loops. - + \note Do not bind to the x, y, width, or height properties of items in a layout, + as this would conflict with the goals of Layout, and can also cause binding loops. + The width and height properties are used by the layout engine to store the current + size of items as calculated from the minimum/preferred/maximum attached properties, + and can be ovewritten each time the items are laid out. Use + \l {Layout::preferredWidth}{Layout.preferredWidth} and + \l {Layout::preferredHeight}{Layout.preferredHeight}, or \l {Item::}{implicitWidth} + and \l {Item::}{implicitHeight} to specify the preferred size of items. \sa GridLayout \sa RowLayout -- cgit v1.2.3