Blame SOURCES/qtdeclarative-5.15.0-FixMaxXMaxYExtent.patch

b602f4
Parent:     f5a4e984 (QQuickTextInputPrivate: refactor getImplicitWidth() to calculateImplicitWidth())
b602f4
Author:     David Redondo <qt@david-redondo.de>
b602f4
AuthorDate: 2020-05-13 11:04:23 +0200
b602f4
Commit:     Mitch Curtis <mitch.curtis@qt.io>
b602f4
CommitDate: 2020-05-25 10:58:35 +0200
b602f4
b602f4
QQuickItemView: Fix max(X/Y)Extent()
b602f4
b602f4
QQuickFlickable maxXExtent() and maxYExtent() return the amount of space
b602f4
that is not shown when inside a ScrollView. QQuickItemView however just
b602f4
returned width() if vertical and height() if horizontal. In these cases
b602f4
just defer to the QQuickFlickable base implementation like minXExtent()
b602f4
and minYExtent() already do.
b602f4
b602f4
This change also adds tst_qquicklistview2 to speed up development.
b602f4
tst_QQuickListView is almost 9000 lines long, and compiling it
b602f4
is slow. In addition, a similar approach (creating a second test to
b602f4
avoid the slowness of a massive one) already exists for QQuickItem
b602f4
tests.
b602f4
b602f4
Fixes: QTBUG-83890
b602f4
Pick-to: 5.15
b602f4
Change-Id: I7f4060c2f46ae07611bedceca0d322c5f7f6affb
50d94e
50d94e
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp
50d94e
index 2b4ca9e2..f2feba2a 100644
50d94e
--- a/src/quick/items/qquickitemview.cpp
50d94e
+++ b/src/quick/items/qquickitemview.cpp
b602f4
@@ -1393,7 +1393,7 @@ qreal QQuickItemView::maxYExtent() const
b602f4
 {
b602f4
     Q_D(const QQuickItemView);
b602f4
     if (d->layoutOrientation() == Qt::Horizontal)
b602f4
-        return height();
b602f4
+        return QQuickFlickable::maxYExtent();
50d94e
b602f4
     if (d->vData.maxExtentDirty) {
b602f4
         d->maxExtent = d->maxExtentForAxis(d->vData, false);
b602f4
@@ -1421,7 +1421,7 @@ qreal QQuickItemView::maxXExtent() const
b602f4
 {
b602f4
     Q_D(const QQuickItemView);
b602f4
     if (d->layoutOrientation() == Qt::Vertical)
b602f4
-        return width();
b602f4
+        return QQuickFlickable::maxXExtent();
50d94e
b602f4
     if (d->hData.maxExtentDirty) {
b602f4
         d->maxExtent = d->maxExtentForAxis(d->hData, true);
50d94e
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
50d94e
index a7aefbe4..afe5c5ac 100644
50d94e
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
50d94e
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
b602f4
@@ -73,6 +73,8 @@ public:
b602f4
     tst_QQuickListView();
50d94e
b602f4
 private slots:
b602f4
+    // WARNING: please add new tests to tst_qquicklistview2; this file is too slow to work with.
b602f4
+
b602f4
     void init();
b602f4
     void cleanupTestCase();
b602f4
     // Test QAbstractItemModel model types
50d94e
@@ -300,6 +302,8 @@ private slots:
b602f4
     void clickHeaderAndFooterWhenClip();
50d94e
     void animatedDelegate();
50d94e
b602f4
+    // WARNING: please add new tests to tst_qquicklistview2; this file is too slow to work with.
b602f4
+
b602f4
 private:
b602f4
     template <class T> void items(const QUrl &source);
b602f4
     template <class T> void changed(const QUrl &source);
50d94e
@@ -10109,6 +10113,8 @@ void tst_QQuickListView::animatedDelegate()
50d94e
     }
b602f4
 }
50d94e
b602f4
+// WARNING: please add new tests to tst_qquicklistview2; this file is too slow to work with.
b602f4
+
b602f4
 QTEST_MAIN(tst_QQuickListView)
50d94e
b602f4
 #include "tst_qquicklistview.moc"
50d94e
diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro
50d94e
index 45bcf8a9..00f7d64d 100644
50d94e
--- a/tests/auto/quick/quick.pro
50d94e
+++ b/tests/auto/quick/quick.pro
b602f4
@@ -67,6 +67,7 @@ QUICKTESTS += \
b602f4
     qquickitem2 \
b602f4
     qquickitemlayer \
b602f4
     qquicklistview \
b602f4
+    qquicklistview2 \
b602f4
     qquicktableview \
b602f4
     qquickloader \
b602f4
     qquickmousearea \