aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
diff options
context:
space:
mode:
authorDavid Redondo <kde@david-redondo.de>2020-05-13 11:04:23 +0200
committerDavid Redondo <qt@david-redondo.de>2022-11-22 17:01:07 +0100
commit99047ae219ff6689da38cc988a25030fece655da (patch)
treea0efbaf9fd2f0d29763ed16f8ef692b8de26de9b /tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
parent3ba1496a65a06b38ee324b5ac10ffec98b22b0c1 (diff)
QQuickItemView: Fix max(X/Y)Extent()
QQuickFlickable maxXExtent() and maxYExtent() return the amount of space that is not shown when inside a ScrollView. QQuickItemView however just returned width() if vertical and height() if horizontal. In these cases just defer to the QQuickFlickable base implementation like minXExtent() and minYExtent() already do. Fixes: QTBUG-83890 Pick-to: 6.2 6.4 Change-Id: I7f4060c2f46ae07611bedceca0d322c5f7f6affb Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicklistview/tst_qquicklistview.cpp')
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index bc372fd040..1bafe01768 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -4285,26 +4285,24 @@ void tst_QQuickListView::extents_data()
QTest::newRow("Vertical, TopToBottom")
<< QQuickListView::Vertical << Qt::LeftToRight << QQuickItemView::TopToBottom
- << QPointF(0, -20) << QPointF(0, 0)
- << QPointF(0, 20) << QPointF(240, 20)
+ << QPointF(0, -20) << QPointF(0, 0) << QPointF(0, 20) << QPointF(0, 20)
<< QPointF(0, -20) << QPointF(0, -20) << QPointF(0, -20);
QTest::newRow("Vertical, BottomToTop")
<< QQuickListView::Vertical << Qt::LeftToRight << QQuickItemView::BottomToTop
- << QPointF(0, 0) << QPointF(0, -30)
- << QPointF(0, 320 - 20) << QPointF(240, 320 - 20) // content flow is reversed
+ << QPointF(0, 0) << QPointF(0, -30) << QPointF(0, 320 - 20)
+ << QPointF(0, 320 - 20) // content flow is reversed
<< QPointF(0, -30) << QPointF(0, (-30.0 * 3) - 30) << QPointF(0, (-30.0 * 30) - 30);
QTest::newRow("Horizontal, LeftToRight")
<< QQuickListView::Horizontal << Qt::LeftToRight << QQuickItemView::TopToBottom
- << QPointF(-20, 0) << QPointF(0, 0)
- << QPointF(20, 0) << QPointF(20, 320)
+ << QPointF(-20, 0) << QPointF(0, 0) << QPointF(20, 0) << QPointF(20, 0)
<< QPointF(-20, 0) << QPointF(-20, 0) << QPointF(-20, 0);
QTest::newRow("Horizontal, RightToLeft")
<< QQuickListView::Horizontal << Qt::RightToLeft << QQuickItemView::TopToBottom
- << QPointF(0, 0) << QPointF(-30, 0)
- << QPointF(240 - 20, 0) << QPointF(240 - 20, 320) // content flow is reversed
+ << QPointF(0, 0) << QPointF(-30, 0) << QPointF(240 - 20, 0)
+ << QPointF(240 - 20, 0) // content flow is reversed
<< QPointF(-30, 0) << QPointF((-240.0 * 3) - 30, 0) << QPointF((-240.0 * 30) - 30, 0);
}