aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2019-04-08 13:32:12 +0200
committerMitch Curtis <mitch.curtis@qt.io>2019-04-08 13:53:39 +0000
commit8349cf8335ca16c7ecc85e877d9f4ec24bad49cd (patch)
tree955004a1aaaa60e0a9ed4f2438997cfd0828402d
parent2431853d824c6416f2cb760485df5cb4c27db7e5 (diff)
Doc: add a Size section to explain StackView's sizing behavior
Task-number: QTBUG-74902 Change-Id: I3f77459028de48729bb78353d8d95e92c7fc98f6 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r--src/quicktemplates2/qquickstackview.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickstackview.cpp b/src/quicktemplates2/qquickstackview.cpp
index 6dae65c8..18f65127 100644
--- a/src/quicktemplates2/qquickstackview.cpp
+++ b/src/quicktemplates2/qquickstackview.cpp
@@ -343,6 +343,35 @@ QT_BEGIN_NAMESPACE
}
\endqml
+ \section1 Size
+
+ StackView does not inherit an implicit size from items that are pushed onto
+ it. This means that using it as the \l {Popup::}{contentItem} of a
+ \l Dialog, for example, will not work as expected:
+
+ \code
+ Dialog {
+ StackView {
+ initialItem: Rectangle {
+ width: 200
+ height: 200
+ color: "salmon"
+ }
+ }
+ }
+ \endcode
+
+ There are several ways to ensure that StackView has a size in this
+ situation:
+
+ \list
+ \li Set \l implicitWidth and \l implicitHeight on the StackView itself.
+ \li Set \l implicitWidth and \l implicitHeight on the \l Rectangle.
+ \li Set \l {Popup::}{contentWidth} and \l {Popup::}{contentHeight} on
+ the Dialog.
+ \li Give the Dialog a size.
+ \endlist
+
\sa {Customizing StackView}, {Navigation Controls}, {Container Controls},
{Focus Management in Qt Quick Controls 2}
*/