aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickscrollview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates2/qquickscrollview.cpp')
-rw-r--r--src/quicktemplates2/qquickscrollview.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickscrollview.cpp b/src/quicktemplates2/qquickscrollview.cpp
index abd75d31..57b0177e 100644
--- a/src/quicktemplates2/qquickscrollview.cpp
+++ b/src/quicktemplates2/qquickscrollview.cpp
@@ -132,6 +132,9 @@ public:
void updateContentWidth();
void updateContentHeight();
+ qreal getContentWidth() const override;
+ qreal getContentHeight() const override;
+
QQuickScrollBar *verticalScrollBar() const;
QQuickScrollBar *horizontalScrollBar() const;
@@ -249,6 +252,28 @@ void QQuickScrollViewPrivate::updateContentHeight()
emit q->implicitContentHeightChanged();
}
+qreal QQuickScrollViewPrivate::getContentWidth() const
+{
+ if (flickable) {
+ const qreal cw = flickable->contentWidth();
+ if (cw > 0)
+ return cw;
+ }
+
+ return QQuickPanePrivate::getContentWidth();
+}
+
+qreal QQuickScrollViewPrivate::getContentHeight() const
+{
+ if (flickable) {
+ const qreal ch = flickable->contentHeight();
+ if (ch > 0)
+ return ch;
+ }
+
+ return QQuickPanePrivate::getContentHeight();
+}
+
QQuickScrollBar *QQuickScrollViewPrivate::verticalScrollBar() const
{
Q_Q(const QQuickScrollView);