diff options
author | Jerome Pasion <jerome.pasion@digia.com> | 2014-10-26 13:36:12 +0100 |
---|---|---|
committer | Jerome Pasion <jerome.pasion@digia.com> | 2014-10-28 19:32:39 +0100 |
commit | 35590b1c3ea1101a67d97e32374b18a28e1bab8d (patch) | |
tree | 9133f13629f01609e925518dbb48c38897c4a783 | |
parent | 60dad7d41160b29146f3513fe631af01581fb737 (diff) | |
download | qtdoc-35590b1c3ea1101a67d97e32374b18a28e1bab8d.tar.gz |
Doc: Added section about Qt Quick Layouts in the layouts use case page.
-also mentioned that Qt Quick 2.1 is required
Task-number: QTBUG-33595
Change-Id: I5cfd2e478fc16ecca792705d56aaddd614759315
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
-rw-r--r-- | doc/src/qmlapp/usecases/layouts.qdoc | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/doc/src/qmlapp/usecases/layouts.qdoc b/doc/src/qmlapp/usecases/layouts.qdoc index 865ad9b3..cd51b86f 100644 --- a/doc/src/qmlapp/usecases/layouts.qdoc +++ b/doc/src/qmlapp/usecases/layouts.qdoc @@ -63,7 +63,7 @@ For full details, see \l {Positioning with Anchors} and the documentation of the \image qmlapp/qml-uses-layouts-anchors.png -\section1 Positioners and Layouts +\section1 Positioners For the common case of wanting to \e position a set of types in a regular pattern, Qt Quick provides some positioner types. Items placed in a positioner are automatically positioned in some way; for example, a \l Row positions items to be @@ -76,6 +76,57 @@ For full details see \l {Item Positioners} and the documentation for \l{qtquick- \image qmlapp/qml-uses-layouts-positioners.png -If \e{positioning and resizing} is desired, you can use the layouts in \l{Qt Quick Layouts}. +\section1 Layout Types + +\e{Layout types} function in a similar way as positioners but allow further refinement or +restrictions to the layout. Specifically, the layout types allow you to: + +\list +\li set the alignment of text and other items +\li resize and fill the allotted application areas automatically +\li set size constraints such as minimum or maximum dimensions +\li set the spacing between items within the layout +\endlist + +\qml + GroupBox { + id: gridBox + title: "Grid layout" + Layout.fillWidth: true + + GridLayout { + id: gridLayout + rows: 3 + flow: GridLayout.TopToBottom + anchors.fill: parent + Label { text: "Line 1" } + Label { text: "Line 2" } + Label { text: "Line 3" } + + TextField { } + TextField { } + TextField { } + + TextArea { + text: "This widget spans over three rows in the GridLayout.\n" + + "All items in the GridLayout are implicitly positioned from top to bottom." + Layout.rowSpan: 3 + Layout.fillHeight: true + Layout.fillWidth: true + } + } + } +\endqml +The snippet above comes from the \l{Qt Quick Controls - Basic Layouts Example}{Basic Layouts} example. The +snippet shows the simplicity of adding various fields and items in a layout. The \l GridLayout can +be resized and its format are customizable through various properties. + +For more information about the layout types, visit: +\list +\li \l{Qt Quick Layouts Overview} +\li \l{Qt Quick Controls - Basic Layouts Example}{Basic Layouts} example +\endlist + +\note \l{Qt Quick Layouts} was introduced in Qt 5.1 and requires \l{Qt Quick} 2.1. */ |