Blame SOURCES/qtdeclarative-5.15.0-FixMaxXMaxYExtent.patch

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