Blame SOURCES/qtdeclarative-5.15.0-FixMaxXMaxYExtent.patch

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