Commit 35590b1c authored by Jerome Pasion's avatar Jerome Pasion
Browse files

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: default avatarVenugopal Shivashankar <venugopal.shivashankar@digia.com>
Showing with 53 additions and 2 deletions
......@@ -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.
*/
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment