diff options
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2020-10-15 09:55:35 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2020-10-15 14:48:48 +0200
commit64f8ab1e2c1c995bb1b4b295861e477f7cfd4e0e (patch)
parent779c22c06bca70bd9d365d3adc3706ea34e491fb (diff)
ScrollView: document how you can make ScrollView scroll in only one direction
It's not obvious how you can make a ScrollView resize the content size in such a way that you're only allowed to scroll in one direction (taking any scroll bars or padding into account). So add a line the explains how you can do it. Pick-to: 5.15 Change-Id: I2d4594d99eab2390d7a5f24710a7e381dbac4c2b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
1 files changed, 7 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickscrollview.cpp b/src/quicktemplates2/qquickscrollview.cpp
index f295ee30..fd936d16 100644
--- a/src/quicktemplates2/qquickscrollview.cpp
+++ b/src/quicktemplates2/qquickscrollview.cpp
@@ -83,7 +83,13 @@ QT_BEGIN_NAMESPACE
\l {QtQuick.Controls::Pane::}{contentHeight} properties must
be set to the combined size of its contained items.
\li If the content size is less than or equal to the size of the ScrollView,
- it will not be flickable.
+ it will not be scrollable.
+ \li If you want the ScrollView to only scroll vertically, you can bind
+ \l {QtQuick.Controls::Pane::}{contentWidth} to
+ \l {QtQuick.Controls::Control::}{availableWidth}
+ (and vice versa for contentHeight). This will let the contents fill
+ out all the available space horizontally inside the ScrollView, taking
+ any padding or scroll bars into account.
\section2 Scroll Bars