Blame SOURCES/qtdeclarative-5.15.0-FixMaxXMaxYExtent.patch

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