This commit is contained in:
Jan Grulich 2023-06-13 09:02:57 +02:00
parent 9bb06552f7
commit f2fa4922fc
9 changed files with 197 additions and 25 deletions

1
.gitignore vendored
View File

@ -18,3 +18,4 @@
/qtquickcontrols2-everywhere-opensource-src-5.15.7.tar.xz
/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

View File

@ -1,7 +1,7 @@
From 4fd68622be6c6b2b16f8d976b640b79d26dcc075 Mon Sep 17 00:00:00 2001
From e303a884f2d700ac0bc70c6147088a9b67becf20 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/5] Unset mouseGrabberPopup if it's removed from children
Subject: [PATCH 1/6] 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.0
2.40.1

View File

@ -1,7 +1,7 @@
From 774cc9a0d8c177b4363b11b80f88296318967385 Mon Sep 17 00:00:00 2001
From a50d27c87d7f8c9e710933b2f808ea132205d9e6 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/5] Ensure we don't crash when changing sizes after cleanup
Subject: [PATCH 2/6] 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.0
2.40.1

View File

@ -1,7 +1,7 @@
From 7145c2589193b0ca0eafbb35085bc5cb5613b055 Mon Sep 17 00:00:00 2001
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/5] Fix scroll bars not showing up when binding to standalone
Subject: [PATCH 3/6] Fix scroll bars not showing up when binding to standalone
contentItem
908aa77d16e00f2bccc0ddae0f8b61955c56a6a1 hid old scroll bars, but
@ -30,10 +30,10 @@ Reviewed-by: Nate Graham
4 files changed, 89 insertions(+)
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index bbbd0e622..1f4b47343 100644
index 409fb582c..da95086e4 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -845,6 +845,13 @@ void QQuickControlPrivate::executeBackground(bool complete)
@@ -846,6 +846,13 @@ void QQuickControlPrivate::executeBackground(bool complete)
quickCompleteDeferred(q, backgroundName(), background);
}
@ -47,7 +47,7 @@ index bbbd0e622..1f4b47343 100644
void QQuickControlPrivate::hideOldItem(QQuickItem *item)
{
if (!item)
@@ -863,6 +870,29 @@ void QQuickControlPrivate::hideOldItem(QQuickItem *item)
@@ -864,6 +871,29 @@ void QQuickControlPrivate::hideOldItem(QQuickItem *item)
#endif
}
@ -175,5 +175,5 @@ index 0e8b08352..cd4931184 100644
+ }
}
--
2.40.0
2.40.1

View File

@ -1,7 +1,7 @@
From 29c60b84e92c83c28211bc349eb00e6c93eeed80 Mon Sep 17 00:00:00 2001
From 9dfd8a5d7cae515cd05953c788fcec38e16ba2f5 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/5] implement a11y pressing of qquickabstractbutton
Subject: [PATCH 4/6] 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.0
2.40.1

View File

@ -1,7 +1,7 @@
From 86a84eaa74c4071e5750f23b6e9911762880d391 Mon Sep 17 00:00:00 2001
From 7baa0cba0b92e7e04825405280ca195dd312dd50 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/5] Fix the popup position of a Menu
Subject: [PATCH 5/6] 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.0
2.40.1

View File

@ -0,0 +1,167 @@
From 0472a07a8f39587052216d85a7ed235c531eba2c 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
controls
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
QQuickItemPrivate::accessibleRole is virtual and called by the framework
to determine the role of an item. The default implementation checks and
respects a possible Accessible attached object. However, subclasses that
override the virtual don't, so the attached properties are ignored, and
the class-specific implementation wins. This makes it impossible to
change the role of e.g. a checkable button.
To fix that, move the code respecting the attached object into a non-
virtual function that the framework calls instead, and only call the
virtual member if there is no attached object, or if that object is not
initialized with a role. Replace calls to the virtual from the
framework with calls to the non-virtual wrapper.
Do this for both QQuickItem and for QQuickPopup, and adjust the logic
in QQuickControl types that create an attached object and initialize
it's role when accessibility becomes active. Use the non-overridable
effective role value for that as well.
Add a test case, and to avoid any new framework calls to the virtual,
make it private.
Fixes: QTBUG-110114
Pick-to: 6.5 6.2
Change-Id: Ia709cecbd181b6d8ee3297a4af60c1e7db9a2c51
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 3c08d08ae2bbd449cc0579a1b3cb499383c7a60c)
---
src/quicktemplates2/qquickcontrol.cpp | 3 ++-
src/quicktemplates2/qquicklabel.cpp | 2 +-
src/quicktemplates2/qquickpopup.cpp | 14 ++++++++++++++
src/quicktemplates2/qquickpopup_p.h | 3 +++
src/quicktemplates2/qquickpopupitem.cpp | 2 +-
src/quicktemplates2/qquicktextarea.cpp | 2 +-
src/quicktemplates2/qquicktextfield.cpp | 2 +-
7 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index da95086e4..c4b05c13c 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -2327,12 +2327,13 @@ QAccessible::Role QQuickControl::accessibleRole() const
void QQuickControl::accessibilityActiveChanged(bool active)
{
+ Q_D(QQuickControl);
if (!active)
return;
QQuickAccessibleAttached *accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(qmlAttachedPropertiesObject<QQuickAccessibleAttached>(this, true));
Q_ASSERT(accessibleAttached);
- accessibleAttached->setRole(accessibleRole());
+ accessibleAttached->setRole(d->effectiveAccessibleRole());
}
#endif
diff --git a/src/quicktemplates2/qquicklabel.cpp b/src/quicktemplates2/qquicklabel.cpp
index 71b60a2bc..2bc621674 100644
--- a/src/quicktemplates2/qquicklabel.cpp
+++ b/src/quicktemplates2/qquicklabel.cpp
@@ -263,7 +263,7 @@ void QQuickLabelPrivate::accessibilityActiveChanged(bool active)
Q_Q(QQuickLabel);
QQuickAccessibleAttached *accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(qmlAttachedPropertiesObject<QQuickAccessibleAttached>(q, true));
Q_ASSERT(accessibleAttached);
- accessibleAttached->setRole(accessibleRole());
+ accessibleAttached->setRole(effectiveAccessibleRole());
maybeSetAccessibleName(text);
}
diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp
index 7df80a047..bfaa84e30 100644
--- a/src/quicktemplates2/qquickpopup.cpp
+++ b/src/quicktemplates2/qquickpopup.cpp
@@ -46,6 +46,7 @@
#include <QtQml/qqmlinfo.h>
#include <QtQuick/qquickitem.h>
+#include <QtQuick/private/qquickaccessibleattached_p.h>
#include <QtQuick/private/qquicktransition_p.h>
#include <QtQuick/private/qquickitem_p.h>
@@ -2720,6 +2721,19 @@ QPalette QQuickPopup::defaultPalette() const
}
#if QT_CONFIG(accessibility)
+QAccessible::Role QQuickPopup::effectiveAccessibleRole() const
+{
+ auto *attached = qmlAttachedPropertiesObject<QQuickAccessibleAttached>(this, false);
+
+ auto role = QAccessible::NoRole;
+ if (auto *accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(attached))
+ role = accessibleAttached->role();
+ if (role == QAccessible::NoRole)
+ role = accessibleRole();
+
+ return role;
+}
+
QAccessible::Role QQuickPopup::accessibleRole() const
{
return QAccessible::Dialog;
diff --git a/src/quicktemplates2/qquickpopup_p.h b/src/quicktemplates2/qquickpopup_p.h
index dc3ebf6f8..a3773be3e 100644
--- a/src/quicktemplates2/qquickpopup_p.h
+++ b/src/quicktemplates2/qquickpopup_p.h
@@ -454,7 +454,10 @@ protected:
virtual QPalette defaultPalette() const;
#if QT_CONFIG(accessibility)
+ QAccessible::Role effectiveAccessibleRole() const;
+private:
virtual QAccessible::Role accessibleRole() const;
+protected:
virtual void accessibilityActiveChanged(bool active);
#endif
diff --git a/src/quicktemplates2/qquickpopupitem.cpp b/src/quicktemplates2/qquickpopupitem.cpp
index 0069b9fc1..143c37fc3 100644
--- a/src/quicktemplates2/qquickpopupitem.cpp
+++ b/src/quicktemplates2/qquickpopupitem.cpp
@@ -404,7 +404,7 @@ QPalette QQuickPopupItem::defaultPalette() const
QAccessible::Role QQuickPopupItem::accessibleRole() const
{
Q_D(const QQuickPopupItem);
- return d->popup->accessibleRole();
+ return d->popup->effectiveAccessibleRole();
}
void QQuickPopupItem::accessibilityActiveChanged(bool active)
diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp
index 64fc631dd..fba3f6b70 100644
--- a/src/quicktemplates2/qquicktextarea.cpp
+++ b/src/quicktemplates2/qquicktextarea.cpp
@@ -512,7 +512,7 @@ void QQuickTextAreaPrivate::accessibilityActiveChanged(bool active)
Q_Q(QQuickTextArea);
QQuickAccessibleAttached *accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(qmlAttachedPropertiesObject<QQuickAccessibleAttached>(q, true));
Q_ASSERT(accessibleAttached);
- accessibleAttached->setRole(accessibleRole());
+ accessibleAttached->setRole(effectiveAccessibleRole());
accessibleAttached->set_readOnly(q->isReadOnly());
accessibleAttached->setDescription(placeholder);
}
diff --git a/src/quicktemplates2/qquicktextfield.cpp b/src/quicktemplates2/qquicktextfield.cpp
index 8fa04bd3a..e83346cbd 100644
--- a/src/quicktemplates2/qquicktextfield.cpp
+++ b/src/quicktemplates2/qquicktextfield.cpp
@@ -359,7 +359,7 @@ void QQuickTextFieldPrivate::accessibilityActiveChanged(bool active)
Q_Q(QQuickTextField);
QQuickAccessibleAttached *accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(qmlAttachedPropertiesObject<QQuickAccessibleAttached>(q, true));
Q_ASSERT(accessibleAttached);
- accessibleAttached->setRole(accessibleRole());
+ accessibleAttached->setRole(effectiveAccessibleRole());
accessibleAttached->set_readOnly(m_readOnly);
accessibleAttached->set_passwordEdit((m_echoMode == QQuickTextField::Password || m_echoMode == QQuickTextField::PasswordEchoOnEdit) ? true : false);
accessibleAttached->setDescription(placeholder);
--
2.40.1

View File

@ -2,7 +2,7 @@
Name: qt5-%{qt_module}
Summary: Qt5 - module with set of QtQuick controls for embedded
Version: 5.15.9
Version: 5.15.10
Release: 1%{?dist}
License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0
@ -10,11 +10,12 @@ 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
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
# filter qml provides
@ -110,6 +111,9 @@ rm -f %{buildroot}%{_qt5_libdir}/libQt5*.la
%{_libdir}/cmake/Qt5QuickTemplates2/
%changelog
* Mon Jun 12 2023 Jan Grulich <jgrulich@redhat.com> - 5.15.10-1
- 5.15.10
* Tue Apr 11 2023 Jan Grulich <jgrulich@redhat.com> - 5.15.9-1
- 5.15.9

View File

@ -1 +1 @@
SHA512 (qtquickcontrols2-everywhere-opensource-src-5.15.9.tar.xz) = f77a59cb6704438bc7b81f816454dad56bebdf4ce7f015c21a05b09f0c508525750a0cf232da8d7428464aa68de9a2bcbd000906fa781aff1e60e8ee5d70802e
SHA512 (qtquickcontrols2-everywhere-opensource-src-5.15.10.tar.xz) = 87e1590223c36b1191f4d976cab946c7d688228032a4a32e699a87ee844d64ed60f93c3c0c148374f4ac6ca619bbf583492cb9b57823b15dd0b9811ca270f390