summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2018-10-11 10:02:59 +0200
committerMitch Curtis <mitch.curtis@qt.io>2018-10-17 10:41:27 +0000
commit614d16d6f0e5e125b5572c4cd2bfe447f939a9b2 (patch)
treecaafa715f904ba69370681f29b5decc83606c301
parent7f57472e24a45a9cb56c7742f4c031405262ef98 (diff)
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 <andy.shaw@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
-rw-r--r--src/imports/layouts/qquicklayout.cpp12
1 files 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