aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2018-07-06 14:36:20 +0200
committerMitch Curtis <mitch.curtis@qt.io>2018-07-09 10:59:53 +0000
commit75ccd3f28d4aaebdd378bd75d76a730240d58a50 (patch)
tree213f9c6ab106503fe860f378d4a5fd1a5062b8fa /src
parent0877ed297ec23323e757ae8f0dd689f8637dee24 (diff)
Doc: clarify and trim down the list in "Using Qt Quick Layouts"
- Clarify that anchors are fine for layouts that are not children of a layout. - Remove redundant list item. Change-Id: I187875ff3970620a6089716c5d9f41cc80997b07 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc b/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc
index d606a761d4..a097ec32d3 100644
--- a/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc
+++ b/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc
@@ -337,8 +337,9 @@ must be considered while using them:
\section2 Dos
\list
- \li Use anchors or the item's width and height properties to specify the size
- of the layout against its parent.
+ \li Use \l {Item::}{anchors} or the \l {Item::}{width} and \l {Item::}{height}
+ properties to specify the size of the layout against its non-layout parent
+ item.
\li Use the \l Layout attached property to set the size and alignment
attributes of the layout's immediate children.
\endlist
@@ -346,12 +347,10 @@ must be considered while using them:
\section2 Don'ts
\list
- \li Do not rely on anchors to specify the preferred size of an item in a layout.
- Instead, use \c Layout.preferredWidth and \c Layout.preferredHeight.
\li Do not define preferred sizes for items that provide implicitWidth and
implicitHeight, unless their implicit sizes are not satisfactory.
- \li Do not mix anchors and layouts in ways that cause conflicts. For example,
- do not apply anchor constraints to a layout's immediate children.
+ \li Do not use anchors on an item that is an immediate child of a layout.
+ Instead, use \c Layout.preferredWidth and \c Layout.preferredHeight:
\snippet qml/windowconstraints.qml rowlayout
\endlist