This commit is contained in:
Jan Grulich 2023-10-08 16:45:10 +02:00
parent 1115e45d28
commit 5736a803af
9 changed files with 29 additions and 206 deletions

1
.gitignore vendored
View File

@ -19,3 +19,4 @@
/qtquickcontrols2-everywhere-opensource-src-5.15.8.tar.xz
/qtquickcontrols2-everywhere-opensource-src-5.15.9.tar.xz
/qtquickcontrols2-everywhere-opensource-src-5.15.10.tar.xz
/qtquickcontrols2-everywhere-opensource-src-5.15.11.tar.xz

View File

@ -1,7 +1,7 @@
From e303a884f2d700ac0bc70c6147088a9b67becf20 Mon Sep 17 00:00:00 2001
From 7c3fbefb8ea1fcfa6c175f8c253f649f5b262d9a Mon Sep 17 00:00:00 2001
From: David Redondo <qt@david-redondo.de>
Date: Mon, 19 Jul 2021 10:06:17 +0200
Subject: [PATCH 1/6] Unset mouseGrabberPopup if it's removed from children
Subject: [PATCH 1/5] Unset mouseGrabberPopup if it's removed from children
The mouseGrabberPopup is supposed to be unset in handleRelease, however
when the exit transition of the mouseGrabberPopup (that closed itself on
@ -178,5 +178,5 @@ index 54952d128..3d50e2dd4 100644
#include "tst_qquickpopup.moc"
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From a50d27c87d7f8c9e710933b2f808ea132205d9e6 Mon Sep 17 00:00:00 2001
From 996ab6f4e9e5f0ac651a9fe69722a707e57d8105 Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Tue, 4 Jan 2022 16:34:16 +0100
Subject: [PATCH 2/6] Ensure we don't crash when changing sizes after cleanup
Subject: [PATCH 2/5] Ensure we don't crash when changing sizes after cleanup
This addresses the problems I've seen during destruction. Only
encountered it when using complex layouts on a DialogButtonBox.
@ -79,5 +79,5 @@ index e6db14eb5..6197d1547 100644
qreal maxHeight = 0;
for (int i = 0; i < count; ++i) {
--
2.40.1
2.41.0

View File

@ -1,179 +0,0 @@
From 2b02c893df78e4b435d56432193e8301fa535d80 Mon Sep 17 00:00:00 2001
From: Mitch Curtis <mitch.curtis@qt.io>
Date: Mon, 18 Jul 2022 15:21:49 +0800
Subject: [PATCH 3/6] Fix scroll bars not showing up when binding to standalone
contentItem
908aa77d16e00f2bccc0ddae0f8b61955c56a6a1 hid old scroll bars, but
didn't account for the situation where the old scroll bars would be put
back into place, and so they never showed up.
In the case of the linked bug report, since there was a binding to the
ScrollView's contentItem, a default Flickable would be created. After
that binding was evaluated, the contentItem was set, causing the scroll
bars to be hidden (as part of the process of disconnecting from the old
flickable). To fix the issue, we now do the reverse of hideOldItem when
a new contentItem is set.
Fixes: QTBUG-104983
Pick-to: 6.2 6.3 6.4
Change-Id: I910259cc3e8f6a6231ae6c87c7d4f0f652bd0545
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Nate Graham
(cherry picked from qtdeclarative 58bae53237417f28eac6d772fa6ecab657f8a73f)
---
src/quicktemplates2/qquickcontrol.cpp | 30 +++++++++++++
src/quicktemplates2/qquickcontrol_p_p.h | 1 +
src/quicktemplates2/qquickscrollbar.cpp | 11 +++++
tests/auto/controls/data/tst_scrollview.qml | 47 +++++++++++++++++++++
4 files changed, 89 insertions(+)
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index 409fb582c..da95086e4 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -846,6 +846,13 @@ void QQuickControlPrivate::executeBackground(bool complete)
quickCompleteDeferred(q, backgroundName(), background);
}
+/*
+ \internal
+
+ Hides an item that was replaced by a newer one, rather than
+ deleting it, as the item is typically created in QML and hence
+ we don't own it.
+*/
void QQuickControlPrivate::hideOldItem(QQuickItem *item)
{
if (!item)
@@ -864,6 +871,29 @@ void QQuickControlPrivate::hideOldItem(QQuickItem *item)
#endif
}
+/*
+ \internal
+
+ Named "unhide" because it's used for cases where an item
+ that was previously hidden by \l hideOldItem() wants to be
+ shown by a control again, such as a ScrollBar in ScrollView.
+*/
+void QQuickControlPrivate::unhideOldItem(QQuickControl *control, QQuickItem *item)
+{
+ Q_ASSERT(item);
+ qCDebug(lcItemManagement) << "unhiding old item" << item;
+
+ item->setVisible(true);
+ item->setParentItem(control);
+
+#if QT_CONFIG(accessibility)
+ // Add the item back in to the accessibility tree.
+ QQuickAccessibleAttached *accessible = accessibleAttached(item);
+ if (accessible)
+ accessible->setIgnored(false);
+#endif
+}
+
void QQuickControlPrivate::updateBaselineOffset()
{
Q_Q(QQuickControl);
diff --git a/src/quicktemplates2/qquickcontrol_p_p.h b/src/quicktemplates2/qquickcontrol_p_p.h
index 8e979079e..a6e624c91 100644
--- a/src/quicktemplates2/qquickcontrol_p_p.h
+++ b/src/quicktemplates2/qquickcontrol_p_p.h
@@ -173,6 +173,7 @@ public:
virtual void executeBackground(bool complete = false);
static void hideOldItem(QQuickItem *item);
+ static void unhideOldItem(QQuickControl *control, QQuickItem *item);
void updateBaselineOffset();
diff --git a/src/quicktemplates2/qquickscrollbar.cpp b/src/quicktemplates2/qquickscrollbar.cpp
index 4e2f509db..1c4b308cd 100644
--- a/src/quicktemplates2/qquickscrollbar.cpp
+++ b/src/quicktemplates2/qquickscrollbar.cpp
@@ -797,6 +797,14 @@ void QQuickScrollBarAttachedPrivate::initHorizontal()
if (parent && parent == flickable->parentItem())
horizontal->stackAfter(flickable);
+ // If a scroll bar was previously hidden (due to e.g. setting a new contentItem
+ // on a ScrollView), we need to make sure that we un-hide it.
+ // We don't bother checking if the item is actually the old one, because
+ // if it's not, all of the things the function does (setting parent, visibility, etc.)
+ // should be no-ops anyway.
+ if (auto control = qobject_cast<QQuickControl*>(q_ptr->parent()))
+ QQuickControlPrivate::unhideOldItem(control, horizontal);
+
layoutHorizontal();
horizontal->setSize(area->property("widthRatio").toReal());
horizontal->setPosition(area->property("xPosition").toReal());
@@ -818,6 +826,9 @@ void QQuickScrollBarAttachedPrivate::initVertical()
if (parent && parent == flickable->parentItem())
vertical->stackAfter(flickable);
+ if (auto control = qobject_cast<QQuickControl*>(q_ptr->parent()))
+ QQuickControlPrivate::unhideOldItem(control, vertical);
+
layoutVertical();
vertical->setSize(area->property("heightRatio").toReal());
vertical->setPosition(area->property("yPosition").toReal());
diff --git a/tests/auto/controls/data/tst_scrollview.qml b/tests/auto/controls/data/tst_scrollview.qml
index 0e8b08352..cd4931184 100644
--- a/tests/auto/controls/data/tst_scrollview.qml
+++ b/tests/auto/controls/data/tst_scrollview.qml
@@ -576,4 +576,51 @@ TestCase {
verify(newHorizontalScrollBar.visible)
verify(!oldHorizontalScrollBar.visible)
}
+
+ Component {
+ id: bindingToContentItemAndStandaloneFlickable
+
+ Item {
+ width: 200
+ height: 200
+
+ property alias scrollView: scrollView
+
+ ScrollView {
+ id: scrollView
+ anchors.fill: parent
+ contentItem: listView
+
+ property Item someBinding: contentItem
+ }
+ ListView {
+ id: listView
+ model: 10
+ delegate: ItemDelegate {
+ text: modelData
+ width: listView.width
+ }
+ }
+ }
+ }
+
+ // Tests that scroll bars show up for a ScrollView where
+ // - its contentItem is declared as a standalone, separate item
+ // - there is a binding to contentItem (which causes a default Flickable to be created)
+ function test_bindingToContentItemAndStandaloneFlickable() {
+ let root = createTemporaryObject(bindingToContentItemAndStandaloneFlickable, testCase)
+ verify(root)
+
+ let control = root.scrollView
+ let verticalScrollBar = control.ScrollBar.vertical
+ let horizontalScrollBar = control.ScrollBar.horizontal
+ compare(verticalScrollBar.parent, control)
+ compare(horizontalScrollBar.parent, control)
+ verify(verticalScrollBar.visible)
+ verify(horizontalScrollBar.visible)
+
+ mouseDrag(verticalScrollBar, verticalScrollBar.width / 2, verticalScrollBar.height / 2, 0, 50)
+ verify(verticalScrollBar.active)
+ verify(horizontalScrollBar.active)
+ }
}
--
2.40.1

View File

@ -1,7 +1,7 @@
From 9dfd8a5d7cae515cd05953c788fcec38e16ba2f5 Mon Sep 17 00:00:00 2001
From c560f43def3003db0acab85bba70616262673767 Mon Sep 17 00:00:00 2001
From: Harald Sitter <sitter@kde.org>
Date: Wed, 2 Nov 2022 12:39:11 +0100
Subject: [PATCH 4/6] implement a11y pressing of qquickabstractbutton
Subject: [PATCH 3/5] implement a11y pressing of qquickabstractbutton
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -51,5 +51,5 @@ index 0fa48980e..ab66220d0 100644
private:
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 7baa0cba0b92e7e04825405280ca195dd312dd50 Mon Sep 17 00:00:00 2001
From c0844c2c2fa9822689ca3d56876c51d79af08e42 Mon Sep 17 00:00:00 2001
From: Inho Lee <inho.lee@qt.io>
Date: Mon, 22 Aug 2022 21:05:00 +0800
Subject: [PATCH 5/6] Fix the popup position of a Menu
Subject: [PATCH 4/5] Fix the popup position of a Menu
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -41,5 +41,5 @@ index e5fe734f7..e36922775 100644
const QWidgetPlatformMenuItem *widgetItem = qobject_cast<const QWidgetPlatformMenuItem *>(item);
m_menu->popup(targetPos, widgetItem ? widgetItem->action() : nullptr);
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 0472a07a8f39587052216d85a7ed235c531eba2c Mon Sep 17 00:00:00 2001
From a2d56960dd76c94a5115b5415be5ee174d377718 Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer <volker.hilsheimer@qt.io>
Date: Tue, 18 Apr 2023 22:05:36 +0200
Subject: [PATCH 6/6] Accessibility: respect value in attached Accessible in
Subject: [PATCH 5/5] Accessibility: respect value in attached Accessible in
controls
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -45,10 +45,10 @@ Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
7 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index da95086e4..c4b05c13c 100644
index a719efd34..768691dac 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -2327,12 +2327,13 @@ QAccessible::Role QQuickControl::accessibleRole() const
@@ -2334,12 +2334,13 @@ QAccessible::Role QQuickControl::accessibleRole() const
void QQuickControl::accessibilityActiveChanged(bool active)
{
@ -163,5 +163,5 @@ index 8fa04bd3a..e83346cbd 100644
accessibleAttached->set_passwordEdit((m_echoMode == QQuickTextField::Password || m_echoMode == QQuickTextField::PasswordEchoOnEdit) ? true : false);
accessibleAttached->setDescription(placeholder);
--
2.40.1
2.41.0

View File

@ -2,21 +2,19 @@
Name: qt5-%{qt_module}
Summary: Qt5 - module with set of QtQuick controls for embedded
Version: 5.15.10
Release: 2%{?dist}
Version: 5.15.11
Release: 1%{?dist}
License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0
Url: http://www.qt.io
%global majmin %(echo %{version} | cut -d. -f1-2)
Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submodules/%{qt_module}-everywhere-opensource-src-%{version}.tar.xz
Patch1: 0001-Unset-mouseGrabberPopup-if-it-s-removed-from-childre.patch
Patch2: 0002-Ensure-we-don-t-crash-when-changing-sizes-after-clea.patch
Patch3: 0003-Fix-scroll-bars-not-showing-up-when-binding-to-stand.patch
Patch4: 0004-implement-a11y-pressing-of-qquickabstractbutton.patch
Patch5: 0005-Fix-the-popup-position-of-a-Menu.patch
Patch6: 0006-Accessibility-respect-value-in-attached-Accessible-i.patch
Patch1: 0001-Unset-mouseGrabberPopup-if-it-s-removed-from-childre.patch
Patch2: 0002-Ensure-we-don-t-crash-when-changing-sizes-after-clea.patch
Patch3: 0003-implement-a11y-pressing-of-qquickabstractbutton.patch
Patch4: 0004-Fix-the-popup-position-of-a-Menu.patch
Patch5: 0005-Accessibility-respect-value-in-attached-Accessible-i.patch
# filter qml provides
%global __provides_exclude_from ^%{_qt5_archdatadir}/qml/.*\\.so$
@ -111,6 +109,9 @@ rm -f %{buildroot}%{_qt5_libdir}/libQt5*.la
%{_libdir}/cmake/Qt5QuickTemplates2/
%changelog
* Fri Oct 06 2023 Jan Grulich <jgrulich@redhat.com> - 5.15.11-1
- 5.15.11
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.15.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (qtquickcontrols2-everywhere-opensource-src-5.15.10.tar.xz) = 87e1590223c36b1191f4d976cab946c7d688228032a4a32e699a87ee844d64ed60f93c3c0c148374f4ac6ca619bbf583492cb9b57823b15dd0b9811ca270f390
SHA512 (qtquickcontrols2-everywhere-opensource-src-5.15.11.tar.xz) = 2621ae1d0c8ebb38ec2c9a0ff28b9bdb3a7aebfd2b6477d145a9772002abdae832aa7daeb8843a8372b32ebe476262650ba23cc977257fd5932499cde796eb32