Drop revert of upstream change

This commit is contained in:
Jan Grulich 2019-10-16 08:07:43 +02:00
parent 9cec05b881
commit ca01ce9ea4
2 changed files with 4 additions and 119 deletions

View File

@ -1,115 +0,0 @@
From 692b2da77427259a3589cf8a1311075863f2f5ec Mon Sep 17 00:00:00 2001
From: Eirik Aavitsland <eirik.aavitsland@qt.io>
Date: Fri, 21 Jun 2019 15:12:36 +0200
Subject: [PATCH 26/56] Fix: ListView footer positioned wrong after last item
removed
The refill() method would bail out early on an empty model. Make sure
that it at least updates the header and footer in such situations.
Fixes: QTBUG-31677
Change-Id: I1f3a1848ff263a8f7f9ccfc3b20f16b61348f57b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
---
src/quick/items/qquickitemview.cpp | 8 ++++-
.../quick/qquicklistview/data/footer2.qml | 33 +++++++++++++++++++
.../qquicklistview/tst_qquicklistview.cpp | 16 +++++++++
3 files changed, 56 insertions(+), 1 deletion(-)
create mode 100644 tests/auto/quick/qquicklistview/data/footer2.qml
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp
index eead84d51..d0715cdb7 100644
--- a/src/quick/items/qquickitemview.cpp
+++ b/src/quick/items/qquickitemview.cpp
@@ -1717,8 +1717,14 @@ void QQuickItemViewPrivate::refill()
void QQuickItemViewPrivate::refill(qreal from, qreal to)
{
Q_Q(QQuickItemView);
- if (!isValid() || !q->isComponentComplete())
+ if (!model || !model->isValid() || !q->isComponentComplete())
return;
+ if (!model->count()) {
+ updateHeader();
+ updateFooter();
+ updateViewport();
+ return;
+ }
do {
bufferPause.stop();
diff --git a/tests/auto/quick/qquicklistview/data/footer2.qml b/tests/auto/quick/qquicklistview/data/footer2.qml
new file mode 100644
index 000000000..bba74d89f
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/footer2.qml
@@ -0,0 +1,33 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 240
+ height: 320
+
+ Timer {
+ running: true
+ repeat: false
+ interval: 100
+ onTriggered: {
+ list.model -= 3;
+ }
+ }
+
+ ListView {
+ id: list
+ objectName: "list"
+ anchors.fill: parent
+ model: 3
+ delegate: Rectangle {
+ color: "red"
+ width: 240
+ height: 10
+ }
+ footer: Rectangle {
+ color: "blue"
+ width: 240
+ height: 10
+ }
+ }
+}
+
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index fddba77f3..cfd740f33 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -152,6 +152,7 @@ private slots:
void headerChangesViewport();
void footer();
void footer_data();
+ void footer2();
void extents();
void extents_data();
void resetModel_headerFooter();
@@ -4138,6 +4139,21 @@ void tst_QQuickListView::footer_data()
<< QPointF(0, -(30 * 20) - 10);
}
+void tst_QQuickListView::footer2() // QTBUG-31677
+{
+ QQuickView *window = getView();
+ window->setSource(testFileUrl("footer2.qml"));
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
+
+ QQuickListView *listview = findItem<QQuickListView>(window->rootObject(), "list");
+ QTRY_VERIFY(listview != nullptr);
+
+ QQuickItem *footer = listview->footerItem();
+ QVERIFY(footer != nullptr);
+ QTRY_COMPARE(footer->y(), 0.0);
+}
+
class LVAccessor : public QQuickListView
{
public:
--
2.21.0

View File

@ -8,7 +8,7 @@
Summary: Qt5 - QtDeclarative component
Name: qt5-%{qt_module}
Version: 5.12.5
Release: 3%{?dist}
Release: 4%{?dist}
# See LICENSE.GPL LICENSE.LGPL LGPL_EXCEPTION.txt, for details
License: LGPLv2 with exceptions or GPLv3 with exceptions
@ -23,9 +23,6 @@ Source5: qv4global_p-multilib.h
## upstream patches
## upstreamable patches
# revert upstream commit that seemingly causes regressions with plasma-5.15.x notifcations applet
# https://bugzilla.redhat.com/1758263
Patch126: 0026-Fix-ListView-footer-positioned-wrong-after-last-item.patch
# filter qml provides
%global __provides_exclude_from ^%{_qt5_archdatadir}/qml/.*\\.so$
@ -196,6 +193,9 @@ make check -k -C tests ||:
%changelog
* Wed Oct 16 2019 Jan Grulich <jgrulich@redhat.com> - 5.12.5-4
- Drop revert of upstream change
* Tue Oct 08 2019 Rex Dieter <rdieter@fedoraproject.org> - 5.12.5-3
- bisected different upstream commit as culprit for plasma notification crasher (#1758263)