aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2018-07-10 11:54:35 +0200
committerMitch Curtis <mitch.curtis@qt.io>2018-07-11 11:42:44 +0000
commit5783cc354b85ba9a77378da34d911a0cfdb31b73 (patch)
tree089110db2cbb4c08cd1deb96bb44f23fac89a206 /src
parent47b02416bfedbb594eb5bca4e898a652184787d9 (diff)
Doc: add "Sizing" section to ScrollView's docs
Mention some important details about contentWidth and contentHeight. Task-number: QTBUG-69376 Change-Id: Iea6c6e36bb11436d30a0284a666c60ab7716f31b Reviewed-by: J-P Nurmi <jpnurmi@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/quicktemplates2/qquickscrollview.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickscrollview.cpp b/src/quicktemplates2/qquickscrollview.cpp
index dba0d95c..451f54d4 100644
--- a/src/quicktemplates2/qquickscrollview.cpp
+++ b/src/quicktemplates2/qquickscrollview.cpp
@@ -70,6 +70,20 @@ QT_BEGIN_NAMESPACE
\snippet qtquickcontrols2-scrollview-listview.qml file
+ \section2 Sizing
+
+ As with Flickable, there are several things to keep in mind when using
+ ScrollView:
+ \list
+ \li If only a single item is used within a ScrollView, the content size is
+ automatically calculated based on the implicit size of its contained item.
+ However, if more than one item is used (or an implicit size is not
+ provided), the \l contentWidth and \l 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.
+ \endlist
+
\section2 Scroll Bars
The horizontal and vertical scroll bars can be accessed and customized using
@@ -359,7 +373,7 @@ QQuickScrollView::QQuickScrollView(QQuickItem *parent)
If only a single item is used within a ScrollView, the content size is
automatically calculated based on the implicit size of its contained item.
- \sa contentHeight
+ \sa contentHeight, Sizing
*/
qreal QQuickScrollView::contentWidth() const
{
@@ -389,7 +403,7 @@ void QQuickScrollView::setContentWidth(qreal width)
If only a single item is used within a ScrollView, the content size is
automatically calculated based on the implicit size of its contained item.
- \sa contentWidth
+ \sa contentWidth, Sizing
*/
qreal QQuickScrollView::contentHeight() const
{