This commit is contained in:
Jan Grulich 2023-10-08 14:44:24 +02:00
parent 47288d4d67
commit 0134d56a72
35 changed files with 739 additions and 212 deletions

1
.gitignore vendored
View File

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

View File

@ -1,7 +1,7 @@
From 7a8bd4c2b3213919343359d5933914ffe1d535e0 Mon Sep 17 00:00:00 2001
From 72c7590b4ede25b2a4fe90847a6c4350e21c6fe9 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <albert.astals.cid@kdab.com>
Date: Thu, 17 Jun 2021 16:32:28 +0200
Subject: [PATCH 01/26] Remove unused QPointer<QQuickPointerMask>
Subject: [PATCH 01/30] Remove unused QPointer<QQuickPointerMask>
Change-Id: I009fa6bbd8599dc3bb2e810176fe20e70ed50851
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
@ -31,5 +31,5 @@ index fba383e268..0d63618622 100644
QPointF targetStartPos;
QPointF lastPos;
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 28c1d895c5220d7f5c49d18ae839feaac0f6e69f Mon Sep 17 00:00:00 2001
From 51b5565f2647e4c0f298c75e7566252d230e1ba6 Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Thu, 23 Sep 2021 03:43:04 +0200
Subject: [PATCH 02/26] QQmlDelegateModel: Refresh the view when a column is
Subject: [PATCH 02/30] QQmlDelegateModel: Refresh the view when a column is
added at 0
It can happen that a model reports n>0 rows but columns=0 (See
@ -174,5 +174,5 @@ index 35f1e2c94d..1722447830 100644
#include "tst_qqmldelegatemodel.moc"
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From ac46066b113c8c8b93277f717dd2f90207ed0e85 Mon Sep 17 00:00:00 2001
From e3e008d519effe76dc0706ce6a9546ee302644f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Arve=20S=C3=A6ther?= <jan-arve.saether@qt.io>
Date: Thu, 3 Sep 2020 10:51:01 +0200
Subject: [PATCH 03/26] Fix TapHandler so that it actually registers a tap
Subject: [PATCH 03/30] Fix TapHandler so that it actually registers a tap
This bug caused all quick examples that used the
shared\LauncherList.qml to be broken.
@ -69,5 +69,5 @@ index d785d8c0ca..a508de455d 100644
void QQuickSinglePointHandler::handlePointerEventImpl(QQuickPointerEvent *event)
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From d6514d71fe897493e76bd5e38bccf9b9159c4880 Mon Sep 17 00:00:00 2001
From e58a94011ac612496b48b76684f8271d11b98ff0 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Tue, 16 Nov 2021 22:43:37 +0100
Subject: [PATCH 04/26] Revert "Fix TapHandler so that it actually registers a
Subject: [PATCH 04/30] Revert "Fix TapHandler so that it actually registers a
tap"
This reverts commit 36e8ccd434f948e4f11a8f9d59139ec072e41ff5.
@ -57,5 +57,5 @@ index a508de455d..d785d8c0ca 100644
void QQuickSinglePointHandler::handlePointerEventImpl(QQuickPointerEvent *event)
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From b02c8610176e1d1ceb65ac5d832d3a21c5a79d47 Mon Sep 17 00:00:00 2001
From 1a7956f606047d4ec669f5759f88d7f34a912589 Mon Sep 17 00:00:00 2001
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Date: Sat, 29 Jan 2022 21:59:33 +0200
Subject: [PATCH 05/26] Make sure QQuickWidget and its offscreen window's
Subject: [PATCH 05/30] Make sure QQuickWidget and its offscreen window's
screens are always in sync
By default, the offscreen window is placed on the primary screen.
@ -20,7 +20,7 @@ Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 39780f8de3..223d91f579 100644
index cf021d9a7c..c791f209cf 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -106,6 +106,7 @@ void QQuickWidgetPrivate::init(QQmlEngine* e)
@ -42,7 +42,7 @@ index 39780f8de3..223d91f579 100644
QOpenGLContext *shareContext = qt_gl_global_share_context();
if (!shareContext)
shareContext = QWidgetPrivate::get(q->window())->shareContext();
@@ -1520,19 +1519,16 @@ bool QQuickWidget::event(QEvent *e)
@@ -1527,19 +1526,16 @@ bool QQuickWidget::event(QEvent *e)
d->handleWindowChange();
break;
@ -70,7 +70,7 @@ index 39780f8de3..223d91f579 100644
if (d->useSoftwareRenderer
#if QT_CONFIG(opengl)
@@ -1545,7 +1541,7 @@ bool QQuickWidget::event(QEvent *e)
@@ -1552,7 +1548,7 @@ bool QQuickWidget::event(QEvent *e)
d->render(true);
}
break;
@ -80,5 +80,5 @@ index 39780f8de3..223d91f579 100644
case QEvent::Move:
d->updatePosition();
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From d1d910545103549912d1b51383a5ace872dfb1f8 Mon Sep 17 00:00:00 2001
From 8fd89860de65760e082e5b9cb2bbfabfe5df309b Mon Sep 17 00:00:00 2001
From: Fabian Kosmale <fabian.kosmale@qt.io>
Date: Wed, 4 May 2022 09:10:54 +0200
Subject: [PATCH 06/26] QQuickItem: Guard against cycles in
Subject: [PATCH 06/30] QQuickItem: Guard against cycles in
nextPrevItemInTabFocusChain
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -118,5 +118,5 @@ index c8f251dbe1..c8ef36ee68 100644
{
if (!qt_tab_all_widgets())
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 70a38e3c897e3ba72b50413d0f994c9f5ebaffd8 Mon Sep 17 00:00:00 2001
From c416839e41ac65cd559176617525a3fb26ca6e2a Mon Sep 17 00:00:00 2001
From: Fushan Wen <qydwhotmail@gmail.com>
Date: Tue, 1 Nov 2022 22:35:24 +0800
Subject: [PATCH 07/26] Don't convert QByteArray in `startDrag`
Subject: [PATCH 07/30] Don't convert QByteArray in `startDrag`
QMimeData::setData expects the provided data to contain the correctly
encoded QByteArray, so if the variant contains a QByteArray, then take
@ -56,5 +56,5 @@ index 8321fcfeed..3b50370355 100644
drag->setMimeData(mimeData);
if (pixmapLoader.isReady()) {
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 63d011a519c1fee2a0f5dbcc204def9e950a168b Mon Sep 17 00:00:00 2001
From 21b1f493febf597b5a4c268970a5285436435466 Mon Sep 17 00:00:00 2001
From: Hannah von Reth <vonreth@kde.org>
Date: Sat, 5 Nov 2022 18:48:41 +0100
Subject: [PATCH 08/26] Fix build after
Subject: [PATCH 08/30] Fix build after
95290f66b806a307b8da1f72f8fc2c69801933d0
---
@ -22,5 +22,5 @@ index 3b50370355..383078b3b9 100644
else
mimeData->setData(it.key(), it.value().toString().toUtf8());
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 95f4632430db5668fa022983c76e4f6bde74c33d Mon Sep 17 00:00:00 2001
From e88fbf0d32d56eea40c8aec75e81b40f21c581a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= <morten.sorvig@qt.io>
Date: Fri, 7 May 2021 10:07:50 +0200
Subject: [PATCH 09/26] Implement accessibility for QQuickWidget
Subject: [PATCH 09/30] Implement accessibility for QQuickWidget
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -469,7 +469,7 @@ index 0000000000..8c63b09f81
+
+#endif
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 223d91f579..9c97b43518 100644
index c791f209cf..b0117683f7 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -39,6 +39,7 @@
@ -561,5 +561,5 @@ index 2438e577ae..f46deb54ac 100644
load(qt_module)
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From ffa3c975270c5026be40912451a289492956f01c Mon Sep 17 00:00:00 2001
From 1d44e89e1ec8a8b9d68035b0cb379dc698673c41 Mon Sep 17 00:00:00 2001
From: Fushan Wen <qydwhotmail@gmail.com>
Date: Sat, 5 Nov 2022 01:44:30 +0800
Subject: [PATCH 10/26] Send ObjectShow event for visible components after
Subject: [PATCH 10/30] Send ObjectShow event for visible components after
initialized
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -42,5 +42,5 @@ index ec55fb2998..499fb61d1b 100644
QQuickStateGroup *QQuickItemPrivate::_states()
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 2384b04415045b2203894b24a3743b03eeadbc88 Mon Sep 17 00:00:00 2001
From 5e53b663378216edbaef243d4e91eaaf45d39e61 Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer <volker.hilsheimer@qt.io>
Date: Wed, 9 Nov 2022 15:34:11 +0100
Subject: [PATCH 11/26] QQuickItem: avoid emitting signals during destruction
Subject: [PATCH 11/30] QQuickItem: avoid emitting signals during destruction
If a QQuickItem is in the QQuickItem destructor, then it is both unsafe
and unnecessary to emit property change notifications. Connected code
@ -109,5 +109,5 @@ index 841d91bb40..ade8fb61f2 100644
enum DirtyType {
TransformOrigin = 0x00000001,
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 5b6faa5cc115d5be8b2300e059592f8dd1a84ac8 Mon Sep 17 00:00:00 2001
From 3fcbf3c50d392401060d4ea65e9bc2f4760ebda3 Mon Sep 17 00:00:00 2001
From: Harald Sitter <sitter@kde.org>
Date: Mon, 28 Nov 2022 14:59:33 +0100
Subject: [PATCH 12/26] a11y: track item enabled state
Subject: [PATCH 12/30] a11y: track item enabled state
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -53,5 +53,5 @@ index 5ee2a440a3..c370d6e5c3 100644
}
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 3d4ff545a998066f563d03bd0e0da6aee81e811d Mon Sep 17 00:00:00 2001
From 4623a7384e6c16b2b5493cbdb9e9d5fcd39a36a5 Mon Sep 17 00:00:00 2001
From: Fabian Kosmale <fabian.kosmale@qt.io>
Date: Tue, 1 Jun 2021 16:40:44 +0200
Subject: [PATCH 13/26] Make QaccessibleQuickWidget private API
Subject: [PATCH 13/30] Make QaccessibleQuickWidget private API
Its base class is private API, so it should be private API, too.
@ -83,5 +83,5 @@ index f46deb54ac..85d156b8a3 100644
SOURCES += \
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 0d21fc0cb74c01368107bf2779c34e5734b5e5ae Mon Sep 17 00:00:00 2001
From 63fbc2eac56cc0df72bbe4287e777e8db334db96 Mon Sep 17 00:00:00 2001
From: Ulf Hermann <ulf.hermann@qt.io>
Date: Tue, 30 Nov 2021 14:39:48 +0100
Subject: [PATCH 14/26] Qml: Don't crash when as-casting to type with errors
Subject: [PATCH 14/30] Qml: Don't crash when as-casting to type with errors
Such types don't have a compilation unit, but we still know their names.
@ -39,10 +39,10 @@ index 175de8b936..a6ba4b8cb3 100644
myQmlType = qenginepriv->metaObjectForType(myTypeId);
}
diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp
index 29ed62cd39..aba930dfe1 100644
index 4a4e6ce12c..a5889b7396 100644
--- a/src/qml/types/qqmlconnections.cpp
+++ b/src/qml/types/qqmlconnections.cpp
@@ -338,7 +338,7 @@ void QQmlConnections::connectSignalsToMethods()
@@ -341,7 +341,7 @@ void QQmlConnections::connectSignalsToMethods()
&& propName.at(2).isUpper()) {
qmlWarning(this) << tr("Detected function \"%1\" in Connections element. "
"This is probably intended to be a signal handler but no "
@ -75,18 +75,18 @@ index 0000000000..bd88d14c76
+ property var selfAsBroken: self as Broken
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index bffb62c59e..97cc64991f 100644
index 1be1533b63..dfc82011c6 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -336,6 +336,7 @@ private slots:
@@ -337,6 +337,7 @@ private slots:
void bareInlineComponent();
void hangOnWarning();
+ void objectAsBroken();
void ambiguousContainingType();
@@ -5876,6 +5877,21 @@ void tst_qqmllanguage::ambiguousContainingType()
void staticConstexprMembers();
@@ -5939,6 +5940,21 @@ void tst_qqmllanguage::bindingAliasToComponentUrl()
}
}
@ -109,5 +109,5 @@ index bffb62c59e..97cc64991f 100644
#include "tst_qqmllanguage.moc"
--
2.40.1
2.41.0

View File

@ -1,54 +0,0 @@
From 4f645419ab8def41d1bdddddc5976b2ff5620bff Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Date: Mon, 19 Dec 2022 10:05:33 +0100
Subject: [PATCH 15/26] Fix missing glyphs when using NativeRendering
When we look up glyphs with subpixel positions in the glyph cache,
we use the calculated subpixel position (from a set of predefined
subpixel positions) as key. In some very rare cases, we could end
up with different subpixel positions when looking up an on-screen
position than when we entered it into the cache, due to numerical
differences when doing the calculation.
The reason for this was that when entering the glyph into the
cache, we used the 16.6 fixed point representation, whereas when
looking up, we used the unmodified float. In some cases, the
converted fixed point approximation might snap to a different
predefined subpixel position than the floating point equivalent.
To avoid this, we reuse the converted fixed point positions when
looking up the glyphs in the cache.
[ChangeLog][Text] Fixed an issue where text using NativeRendering
would sometimes be missing glyphs.
Pick-to: 5.15 6.2 6.4 6.5
Fixes: QTBUG-108713
Change-Id: Iecc264eb3d27e875c24257eaefcfb18a1a5fb5be
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 4bad329985b75090c68a70cceee7edadc172d7ab)
---
src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
index f912da5799..fd128aa06e 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
+++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
@@ -839,9 +839,11 @@ void QSGTextMaskMaterial::populate(const QPointF &p,
bool supportsSubPixelPositions = fontD->fontEngine->supportsSubPixelPositions();
for (int i=0; i<glyphIndexes.size(); ++i) {
QPointF glyphPosition = glyphPositions.at(i) + position;
+ QFixedPoint fixedPointPosition = fixedPointPositions.at(i);
+
QFixed subPixelPosition;
if (supportsSubPixelPositions)
- subPixelPosition = fontD->fontEngine->subPixelPositionForX(QFixed::fromReal(glyphPosition.x()));
+ subPixelPosition = fontD->fontEngine->subPixelPositionForX(QFixed::fromReal(fixedPointPosition.x.toReal() * glyphCacheScaleX));
QTextureGlyphCache::GlyphAndSubPixelPosition glyph(glyphIndexes.at(i), subPixelPosition);
const QTextureGlyphCache::Coord &c = cache->coords.value(glyph);
--
2.40.1

View File

@ -1,7 +1,7 @@
From 0d217b88c6bf5673464e350e3a62773e69555f98 Mon Sep 17 00:00:00 2001
From 752b5bfa37c0b059883f52fcec4a41efc78521ad Mon Sep 17 00:00:00 2001
From: Jaeyoon Jung <jaeyoon.jung@lge.com>
Date: Fri, 19 Feb 2021 08:11:57 +0900
Subject: [PATCH 17/26] QQmlImportDatabase: Make sure the newly added import
Subject: [PATCH 15/30] QQmlImportDatabase: Make sure the newly added import
path be first
If it already exists in the import list, move it to the first place.
@ -17,10 +17,10 @@ Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 10c6c41338..39bfcdc999 100644
index e7263d1850..289f11d006 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -2120,9 +2120,12 @@ void QQmlImportDatabase::addImportPath(const QString& path)
@@ -2119,9 +2119,12 @@ void QQmlImportDatabase::addImportPath(const QString& path)
cPath.replace(Backslash, Slash);
}
@ -53,5 +53,5 @@ index 9c865b3f73..1f788f7a7f 100644
Q_DECLARE_METATYPE(QQmlImports::ImportVersion)
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 35608b36b284000f5871deb6a0d58113110e01e8 Mon Sep 17 00:00:00 2001
From d790abcf04fde46d1d8ecdf8268a1a71c085c651 Mon Sep 17 00:00:00 2001
From: Fabian Kosmale <fabian.kosmale@qt.io>
Date: Wed, 20 Jul 2022 11:44:43 +0200
Subject: [PATCH 18/26] QQuickState::when: handle QJSValue properties correctly
Subject: [PATCH 16/30] QQuickState::when: handle QJSValue properties correctly
If one assigns a binding whose evaluation results in a QJSValue, care
must be take to correctly convert it into a bool. Instead of directly
@ -98,5 +98,5 @@ index aa55b42935..26e86672b0 100644
{
QQmlEngine engine;
--
2.40.1
2.41.0

View File

@ -1,32 +0,0 @@
From 187bb66368921ce4a6522aca78531714485c377c Mon Sep 17 00:00:00 2001
From: Fushan Wen <qydwhotmail@gmail.com>
Date: Tue, 10 Jan 2023 20:42:04 +0800
Subject: [PATCH 16/26] Revert "Fix missing glyphs when using NativeRendering"
This reverts commit da5e53b649f50cd9cdd89dadbba16f05e4070be2.
It breaks fonts on Wayland when global scale > 100%.
---
src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
index fd128aa06e..f912da5799 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
+++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
@@ -839,11 +839,9 @@ void QSGTextMaskMaterial::populate(const QPointF &p,
bool supportsSubPixelPositions = fontD->fontEngine->supportsSubPixelPositions();
for (int i=0; i<glyphIndexes.size(); ++i) {
QPointF glyphPosition = glyphPositions.at(i) + position;
- QFixedPoint fixedPointPosition = fixedPointPositions.at(i);
-
QFixed subPixelPosition;
if (supportsSubPixelPositions)
- subPixelPosition = fontD->fontEngine->subPixelPositionForX(QFixed::fromReal(fixedPointPosition.x.toReal() * glyphCacheScaleX));
+ subPixelPosition = fontD->fontEngine->subPixelPositionForX(QFixed::fromReal(glyphPosition.x()));
QTextureGlyphCache::GlyphAndSubPixelPosition glyph(glyphIndexes.at(i), subPixelPosition);
const QTextureGlyphCache::Coord &c = cache->coords.value(glyph);
--
2.40.1

View File

@ -1,7 +1,7 @@
From 32730dad9adcaab137cf2fe434b03be23bbe9c7d Mon Sep 17 00:00:00 2001
From 4e9cc24046159483e47142cadbf432ff5d76981d Mon Sep 17 00:00:00 2001
From: Ulf Hermann <ulf.hermann@qt.io>
Date: Wed, 29 Mar 2023 16:36:03 +0200
Subject: [PATCH 19/26] Models: Avoid crashes when deleting cache items
Subject: [PATCH 17/30] Models: Avoid crashes when deleting cache items
Pick-to: 6.5 6.2 5.15
Fixes: QTBUG-91425
@ -158,5 +158,5 @@ index 1722447830..f473cff75f 100644
#include "tst_qqmldelegatemodel.moc"
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From adad56c92c633248f0fe467f8e0c32dc461f6716 Mon Sep 17 00:00:00 2001
From be8e5e55717acafa3c4f3d0368b4a9b1e8f6b862 Mon Sep 17 00:00:00 2001
From: Maximilian Goldstein <max.goldstein@qt.io>
Date: Wed, 9 Jun 2021 15:02:45 +0200
Subject: [PATCH 20/26] qv4function: Fix crash due to reference being
Subject: [PATCH 18/30] qv4function: Fix crash due to reference being
invalidated
Function::updateInternalClass creates a reference to a QStringList that is appended to before being used.
@ -18,7 +18,7 @@ Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index aeb4835c40..9082628a1a 100644
index cf8a53cf9f..223e64271e 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -136,7 +136,7 @@ void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArr
@ -31,5 +31,5 @@ index aeb4835c40..9082628a1a 100644
parameterNames[duplicate] =
QString(0xfffe) + QString::number(duplicate) + dup;
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From cc1b9e7d4aac93d0767e83431be5a5aebcdffb59 Mon Sep 17 00:00:00 2001
From 9c97a85fbec3d6ad40cdae00a06bac1fc8c06665 Mon Sep 17 00:00:00 2001
From: Fabian Kosmale <fabian.kosmale@qt.io>
Date: Tue, 29 Mar 2022 10:44:04 +0200
Subject: [PATCH 21/26] Quick Animations: Fix crash
Subject: [PATCH 19/30] Quick Animations: Fix crash
SwipeDelegate causes the running animation job to be deleted when
calling swipe.close in swipe.completed. Employ the RETURN_IF_DELETED
@ -137,5 +137,5 @@ index 0000000000..38dfde41c3
+ }
+}
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 3366947eb58c0c5ad8a7e714a6b9667e1c3ff7b8 Mon Sep 17 00:00:00 2001
From 3e199737af8faee64cb940aef904537b658fe375 Mon Sep 17 00:00:00 2001
From: Joni Poikelin <joni.poikelin@qt.io>
Date: Thu, 3 Sep 2020 14:22:26 +0300
Subject: [PATCH 22/26] Prevent crash when destroying asynchronous Loader
Subject: [PATCH 20/30] Prevent crash when destroying asynchronous Loader
Fixes: QTBUG-86255
Pick-to: 5.15
@ -20,10 +20,10 @@ Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
create mode 100644 tests/auto/quick/qquickgridview/data/qtbug86255.qml
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp
index aa9f4bc1bd..09503a7e99 100644
index 1e0e4e419f..a0532d1794 100644
--- a/src/qml/qml/qqmlvmemetaobject.cpp
+++ b/src/qml/qml/qqmlvmemetaobject.cpp
@@ -254,7 +254,7 @@ void QQmlVMEMetaObjectEndpoint::tryConnect()
@@ -251,7 +251,7 @@ void QQmlVMEMetaObjectEndpoint::tryConnect()
if (!pd)
return;
@ -125,5 +125,5 @@ index 94ec4f44d5..7d0d9fa7a7 100644
{
QScopedPointer<QQuickView> view(createView());
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 688795f02ecc163e7cb18dfb6c87273d7e613cbf Mon Sep 17 00:00:00 2001
From 632e062466b5252049b3bf1d75c91d5e010f021c Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer <volker.hilsheimer@qt.io>
Date: Fri, 18 Nov 2022 14:20:20 +0100
Subject: [PATCH 23/26] QQuickItem: Fix effective visibility for items without
Subject: [PATCH 21/30] QQuickItem: Fix effective visibility for items without
parent
Items are visible if they are children of a visible parent, and not
@ -77,5 +77,5 @@ index 42348d8dd1..34eefd85e6 100644
QQuickItem *child1 = new QQuickItem;
child1->setParentItem(root);
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 70bc0c03423fe861bb917c67041f71e08ec10343 Mon Sep 17 00:00:00 2001
From 75d7d0370a3a19615e9aab6a23519eb529e4de87 Mon Sep 17 00:00:00 2001
From: Fushan Wen <qydwhotmail@gmail.com>
Date: Fri, 21 Apr 2023 23:38:04 +0800
Subject: [PATCH 24/26] Revert "QQuickItem: Fix effective visibility for items
Subject: [PATCH 22/30] Revert "QQuickItem: Fix effective visibility for items
without parent"
This breaks applications that use QQmlPropertyList to store QQuickItem
@ -47,5 +47,5 @@ index 34eefd85e6..42348d8dd1 100644
QQuickItem *child1 = new QQuickItem;
child1->setParentItem(root);
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From a9f99d945e23b915502ddbd56e20a2af9f33296e Mon Sep 17 00:00:00 2001
From be69e9b1443cff30d241100bafc91d447cc0b2f5 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 25/26] Accessibility: respect value in attached Accessible in
Subject: [PATCH 23/30] Accessibility: respect value in attached Accessible in
controls
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -107,5 +107,5 @@ index ade8fb61f2..6f329bd119 100644
void setImplicitAntialiasing(bool antialiasing);
--
2.40.1
2.41.0

View File

@ -1,7 +1,7 @@
From 5352f113b3c7a5af2ad2741d593c6e6a758eb93e Mon Sep 17 00:00:00 2001
From f2e8ebd9e19e0d725c820010ab3cdf153fd62a3b Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Tue, 16 May 2023 07:59:46 +0200
Subject: [PATCH 26/26] qml tool: Use QCommandLineParser::process() rather than
Subject: [PATCH 24/30] qml tool: Use QCommandLineParser::process() rather than
parse()
This handles the --version, --help and --help-all options.
@ -53,5 +53,5 @@ index beeec88f07..2cb7653d65 100644
listConfFiles();
if (applicationType == QmlApplicationTypeUnknown) {
--
2.40.1
2.41.0

View File

@ -1,7 +1,8 @@
From e2bdde18d9758efdc6a0d7d106aad56995df1271 Mon Sep 17 00:00:00 2001
From cbfce7fd236c5305d85371c058a34f8f25e949fa Mon Sep 17 00:00:00 2001
From: Ulf Hermann <ulf.hermann@qt.io>
Date: Wed, 15 Mar 2023 08:59:43 +0100
Subject: [PATCH] JIT: Add missing {STORE|LOAD}_ACC() to CreateCallContext
Subject: [PATCH 25/30] JIT: Add missing {STORE|LOAD}_ACC() to
CreateCallContext
We cannot assume anything about the accumulator register after calling
PushCallContext::call(). Also add a note about not needing to re-load
@ -10,15 +11,19 @@ the accumulator on ThrowException.
Pick-to: 6.5 6.2 5.15
Fixes: QTBUG-111935
Change-Id: I7196585e1d2697c215f4fe87d8d7ac9b98b622a3
Reviewed-by: <carl@carlschwan.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 15ec024152a1d1d99a4934f7b2408e7af7b2552a)
---
src/qml/jit/qv4baselinejit.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/qml/jit/qv4baselinejit.cpp b/src/qml/jit/qv4baselinejit.cpp
index 14e183adb8..1d65169dce 100644
index 45150cfffd..5ad53faf95 100644
--- a/src/qml/jit/qv4baselinejit.cpp
+++ b/src/qml/jit/qv4baselinejit.cpp
@@ -506,6 +506,8 @@ void BaselineJIT::generate_ThrowException()
@@ -540,6 +540,8 @@ void BaselineJIT::generate_ThrowException()
as->passEngineAsArg(0);
BASELINEJIT_GENERATE_RUNTIME_CALL(ThrowException, CallResultDestination::Ignore);
as->gotoCatchException();
@ -27,7 +32,7 @@ index 14e183adb8..1d65169dce 100644
}
void BaselineJIT::generate_GetException() { as->getException(); }
@@ -513,9 +515,11 @@ void BaselineJIT::generate_SetException() { as->setException(); }
@@ -547,9 +549,11 @@ void BaselineJIT::generate_SetException() { as->setException(); }
void BaselineJIT::generate_CreateCallContext()
{
@ -40,5 +45,5 @@ index 14e183adb8..1d65169dce 100644
void BaselineJIT::generate_PushCatchContext(int index, int name) { as->pushCatchContext(index, name); }
--
2.39.2
2.41.0

View File

@ -0,0 +1,45 @@
From 7368a55a926719577c36e5978d67c008474a85a0 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Tue, 27 Jun 2023 13:02:45 +0200
Subject: [PATCH 26/30] QQmlJs::MemoryPool: fix potential UB (pointer overflow)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
A check like (p1 + s op p2) is dangerous, because p1 + s may overflow,
and that would be UB, so the compiler can assume it doesn't happen and
break the check.
Reformulate the expression by subtracting p1 from both sides. Cast the
ptrdiff_t to size_t to avoid -Wsign-compare. This is safe because _end
is always ≥ _ptr.
As a drive-by, remove extra parentheses.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: If240d685fe48196ab5ceb7ff39736b73c8997e30
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 8a39f7655f4cfbc35c1886b49e2f3a9ada263e39)
* asturmlechner 2023-06-29: Resolve conflict with dev branch commit
1b10ce6a08edbc2ac7e8fd7e97e3fc691f2081df by dropping unrelated bits
---
src/qml/common/qqmljsmemorypool_p.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qml/common/qqmljsmemorypool_p.h b/src/qml/common/qqmljsmemorypool_p.h
index 0cf7ea84e6..1b81a87a2c 100644
--- a/src/qml/common/qqmljsmemorypool_p.h
+++ b/src/qml/common/qqmljsmemorypool_p.h
@@ -87,7 +87,7 @@ public:
inline void *allocate(size_t size)
{
size = (size + 7) & ~size_t(7);
- if (Q_LIKELY(_ptr && (_ptr + size < _end))) {
+ if (Q_LIKELY(_ptr && size < size_t(_end - _ptr))) {
void *addr = _ptr;
_ptr += size;
return addr;
--
2.41.0

View File

@ -0,0 +1,54 @@
From d15af4ca5c7b94b1ce1fa202c33e5dc1640185c7 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Mon, 26 Jun 2023 11:00:56 +0200
Subject: [PATCH 27/30] QRecyclePool: fix potential UB
Return the pointer returned by placement new, not the pointer used as
input to placement new. There is a subtle difference and this grey
zone of the C++ standard is best avoided (keyword: std::launder()).
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I27c159cdb29a5837120f3d44aa6c95da040fd1a2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 7381110745572478ffa3c68000574bc4ccb2396c)
---
src/qml/qml/ftw/qrecyclepool_p.h | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/qml/qml/ftw/qrecyclepool_p.h b/src/qml/qml/ftw/qrecyclepool_p.h
index 39f4f88512..c963e1878e 100644
--- a/src/qml/qml/ftw/qrecyclepool_p.h
+++ b/src/qml/qml/ftw/qrecyclepool_p.h
@@ -130,8 +130,7 @@ template<typename T, int Step>
T *QRecyclePool<T, Step>::New()
{
T *rv = d->allocate();
- new (rv) T;
- return rv;
+ return new (rv) T;
}
template<typename T, int Step>
@@ -139,8 +138,7 @@ template<typename T1>
T *QRecyclePool<T, Step>::New(const T1 &a)
{
T *rv = d->allocate();
- new (rv) T(a);
- return rv;
+ return new (rv) T(a);
}
template<typename T, int Step>
@@ -148,8 +146,7 @@ template<typename T1>
T *QRecyclePool<T, Step>::New(T1 &a)
{
T *rv = d->allocate();
- new (rv) T(a);
- return rv;
+ return new (rv) T(a);
}
template<typename T, int Step>
--
2.41.0

View File

@ -0,0 +1,111 @@
From 6d290336ef7c65041c7f6eb9b5094f6c4de5f845 Mon Sep 17 00:00:00 2001
From: Ulf Hermann <ulf.hermann@qt.io>
Date: Mon, 10 Jul 2023 07:43:28 +0200
Subject: [PATCH 28/30] QtQml: Clean up QQmlData ctor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Initialize the "dummy" member even though we never use it. Static
analyzers complain about it and we may appreciate it having a defined
value in the future. Also, initialize other members inline where
possible.
Coverity-Id: 415867
Change-Id: Ie428eb3294d6363afe9d7ab2d2bed6e52df0b304
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 10985a568db8cfb4140140967f7d247627ec4350)
* asturmlechner 2023-08-12: Resolve conflicts with dev branch commits
10985a568db8cfb4140140967f7d247627ec4350 and
e5246cafffb93f69a49c133210390c253fcb71f2 and
d3b3fef5a878d7fd53de6a9f9fff196a273930e3
---
src/qml/qml/qqmldata_p.h | 20 ++++++++++----------
src/qml/qml/qqmlengine.cpp | 7 ++-----
2 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/src/qml/qml/qqmldata_p.h b/src/qml/qml/qqmldata_p.h
index ee31cb38d9..bb0adf9dfa 100644
--- a/src/qml/qml/qqmldata_p.h
+++ b/src/qml/qml/qqmldata_p.h
@@ -187,7 +187,7 @@ public:
private:
void layout(QQmlNotifierEndpoint*);
};
- NotifyList *notifyList;
+ NotifyList *notifyList = nullptr;
inline QQmlNotifierEndpoint *notify(int index);
void addNotify(int index, QQmlNotifierEndpoint *);
@@ -201,12 +201,12 @@ public:
QQmlContextData *outerContext = nullptr;
QQmlContextDataRef ownContext;
- QQmlAbstractBinding *bindings;
- QQmlBoundSignal *signalHandlers;
+ QQmlAbstractBinding *bindings = nullptr;
+ QQmlBoundSignal *signalHandlers = nullptr;
// Linked list for QQmlContext::contextObjects
- QQmlData *nextContextObject;
- QQmlData**prevContextObject;
+ QQmlData *nextContextObject = nullptr;
+ QQmlData**prevContextObject = nullptr;
inline bool hasBindingBit(int) const;
inline void setBindingBit(QObject *obj, int);
@@ -216,10 +216,10 @@ public:
inline void setPendingBindingBit(QObject *obj, int);
inline void clearPendingBindingBit(int);
- quint16 lineNumber;
- quint16 columnNumber;
+ quint16 lineNumber = 0;
+ quint16 columnNumber = 0;
- quint32 jsEngineId; // id of the engine that created the jsWrapper
+ quint32 jsEngineId = 0; // id of the engine that created the jsWrapper
struct DeferredData {
DeferredData();
@@ -240,7 +240,7 @@ public:
QQmlPropertyCache *propertyCache;
- QQmlGuardImpl *guards;
+ QQmlGuardImpl *guards = 0;
static QQmlData *get(const QObject *object, bool create = false) {
QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object));
@@ -289,7 +289,7 @@ public:
private:
// For attachedProperties
- mutable QQmlDataExtended *extendedData;
+ mutable QQmlDataExtended *extendedData = nullptr;
Q_NEVER_INLINE static QQmlData *createQQmlData(QObjectPrivate *priv);
Q_NEVER_INLINE static QQmlPropertyCache *createPropertyCache(QJSEngine *engine, QObject *object);
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 852a673ebd..86a2d2b45a 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -725,11 +725,8 @@ void QQmlPrivate::qdeclarativeelement_destructor(QObject *o)
QQmlData::QQmlData()
: ownedByQml1(false), ownMemory(true), indestructible(true), explicitIndestructibleSet(false),
hasTaintedV4Object(false), isQueuedForDeletion(false), rootObjectInCreation(false),
- hasInterceptorMetaObject(false), hasVMEMetaObject(false), parentFrozen(false),
- bindingBitsArraySize(InlineBindingArraySize), notifyList(nullptr),
- bindings(nullptr), signalHandlers(nullptr), nextContextObject(nullptr), prevContextObject(nullptr),
- lineNumber(0), columnNumber(0), jsEngineId(0),
- propertyCache(nullptr), guards(nullptr), extendedData(nullptr)
+ hasInterceptorMetaObject(false), hasVMEMetaObject(false), parentFrozen(false), dummy(0),
+ bindingBitsArraySize(InlineBindingArraySize), propertyCache(nullptr)
{
memset(bindingBitsValue, 0, sizeof(bindingBitsValue));
init();
--
2.41.0

View File

@ -0,0 +1,277 @@
From 9f029563b151eb4a41f9b548376093e288aa0331 Mon Sep 17 00:00:00 2001
From: Ulf Hermann <ulf.hermann@qt.io>
Date: Tue, 8 Aug 2023 14:54:01 +0200
Subject: [PATCH 29/30] QML: Make notify list thread safe
We keep the notifyList itself alive until the QQmlData itself is
deleted. This way any isSignalConnected() called while an
intermediate dtor runs can safely access it. We use atomics to make the
concurrent access to the pointer and the connection mask defined
behavior. However, we never need anything but relaxed semantics when
accessing it.
Pick-to: 5.15 6.2 6.5 6.6
Fixes: QTBUG-105090
Change-Id: I82537be86e5cc33c2a3d76ec639fcbac87eb45ad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 691956654c1acab356ce704c58602cc3a99fabc3)
* asturmlechner 2023-08-12: Resolve conflict with dev branch commit
c249edb83fa67b3e5f711b28923397e66876182d which introduces a behavior
change, so cannot be backported. Applied changes logically as if that
commit never happened.
---
src/qml/qml/qqmldata_p.h | 66 ++++++++++++++++++-----------
src/qml/qml/qqmlengine.cpp | 85 +++++++++++++++++++++++++-------------
2 files changed, 99 insertions(+), 52 deletions(-)
diff --git a/src/qml/qml/qqmldata_p.h b/src/qml/qml/qqmldata_p.h
index bb0adf9dfa..187339169b 100644
--- a/src/qml/qml/qqmldata_p.h
+++ b/src/qml/qml/qqmldata_p.h
@@ -176,24 +176,24 @@ public:
};
struct NotifyList {
- quint64 connectionMask;
-
- quint16 maximumTodoIndex;
- quint16 notifiesSize;
-
- QQmlNotifierEndpoint *todo;
- QQmlNotifierEndpoint**notifies;
+ QAtomicInteger<quint64> connectionMask;
+ QQmlNotifierEndpoint *todo = nullptr;
+ QQmlNotifierEndpoint**notifies = nullptr;
+ quint16 maximumTodoIndex = 0;
+ quint16 notifiesSize = 0;
void layout();
private:
void layout(QQmlNotifierEndpoint*);
};
- NotifyList *notifyList = nullptr;
+ QAtomicPointer<NotifyList> notifyList;
- inline QQmlNotifierEndpoint *notify(int index);
+ inline QQmlNotifierEndpoint *notify(int index) const;
void addNotify(int index, QQmlNotifierEndpoint *);
int endpointCount(int index);
bool signalHasEndpoint(int index) const;
- void disconnectNotifiers();
+
+ enum class DeleteNotifyList { Yes, No };
+ void disconnectNotifiers(DeleteNotifyList doDelete);
// The context that created the C++ object
QQmlContextData *context = nullptr;
@@ -240,7 +240,7 @@ public:
QQmlPropertyCache *propertyCache;
- QQmlGuardImpl *guards = 0;
+ QQmlGuardImpl *guards = nullptr;
static QQmlData *get(const QObject *object, bool create = false) {
QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object));
@@ -342,23 +342,31 @@ bool QQmlData::wasDeleted(const QObject *object)
return ddata && ddata->isQueuedForDeletion;
}
-QQmlNotifierEndpoint *QQmlData::notify(int index)
+inline bool isIndexInConnectionMask(quint64 connectionMask, int index)
+{
+ return connectionMask & (1ULL << quint64(index % 64));
+}
+
+QQmlNotifierEndpoint *QQmlData::notify(int index) const
{
+ // Can only happen on "home" thread. We apply relaxed semantics when loading the atomics.
+
Q_ASSERT(index <= 0xFFFF);
- if (!notifyList || !(notifyList->connectionMask & (1ULL << quint64(index % 64)))) {
+ NotifyList *list = notifyList.loadRelaxed();
+ if (!list || !isIndexInConnectionMask(list->connectionMask.loadRelaxed(), index))
return nullptr;
- } else if (index < notifyList->notifiesSize) {
- return notifyList->notifies[index];
- } else if (index <= notifyList->maximumTodoIndex) {
- notifyList->layout();
- }
- if (index < notifyList->notifiesSize) {
- return notifyList->notifies[index];
- } else {
- return nullptr;
+ if (index < list->notifiesSize)
+ return list->notifies[index];
+
+ if (index <= list->maximumTodoIndex) {
+ list->layout();
+ if (index < list->notifiesSize)
+ return list->notifies[index];
}
+
+ return nullptr;
}
/*
@@ -367,7 +375,19 @@ QQmlNotifierEndpoint *QQmlData::notify(int index)
*/
inline bool QQmlData::signalHasEndpoint(int index) const
{
- return notifyList && (notifyList->connectionMask & (1ULL << quint64(index % 64)));
+ // This can be called from any thread.
+ // We still use relaxed semantics. If we're on a thread different from the "home" thread
+ // of the QQmlData, two interesting things might happen:
+ //
+ // 1. The list might go away while we hold it. In that case we are dealing with an object whose
+ // QObject dtor is being executed concurrently. This is UB already without the notify lists.
+ // Therefore, we don't need to consider it.
+ // 2. The connectionMask may be amended or zeroed while we are looking at it. In that case
+ // we "misreport" the endpoint. Since ordering of events across threads is inherently
+ // nondeterministic, either result is correct in that case. We can accept it.
+
+ NotifyList *list = notifyList.loadRelaxed();
+ return list && isIndexInConnectionMask(list->connectionMask.loadRelaxed(), index);
}
bool QQmlData::hasBindingBit(int coreIndex) const
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 86a2d2b45a..d6b2711c2d 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -718,7 +718,7 @@ void QQmlPrivate::qdeclarativeelement_destructor(QObject *o)
// Disconnect the notifiers now - during object destruction this would be too late, since
// the disconnect call wouldn't be able to call disconnectNotify(), as it isn't possible to
// get the metaobject anymore.
- d->disconnectNotifiers();
+ d->disconnectNotifiers(QQmlData::DeleteNotifyList::No);
}
}
@@ -786,7 +786,10 @@ void QQmlData::signalEmitted(QAbstractDeclarativeData *, QObject *object, int in
// QQmlEngine to emit signals from a different thread. These signals are then automatically
// marshalled back onto the QObject's thread and handled by QML from there. This is tested
// by the qqmlecmascript::threadSignal() autotest.
- if (!ddata->notifyList)
+
+ // Relaxed semantics here. If we're on a different thread we might schedule a useless event,
+ // but that should be rare.
+ if (!ddata->notifyList.loadRelaxed())
return;
auto objectThreadData = QObjectPrivate::get(object)->threadData.loadRelaxed();
@@ -1832,49 +1835,73 @@ void QQmlData::releaseDeferredData()
void QQmlData::addNotify(int index, QQmlNotifierEndpoint *endpoint)
{
- if (!notifyList) {
- notifyList = (NotifyList *)malloc(sizeof(NotifyList));
- notifyList->connectionMask = 0;
- notifyList->maximumTodoIndex = 0;
- notifyList->notifiesSize = 0;
- notifyList->todo = nullptr;
- notifyList->notifies = nullptr;
+ // Can only happen on "home" thread. We apply relaxed semantics when loading the atomics.
+
+ NotifyList *list = notifyList.loadRelaxed();
+
+ if (!list) {
+ list = new NotifyList;
+ // We don't really care when this change takes effect on other threads. The notifyList can
+ // only become non-null once in the life time of a QQmlData. It becomes null again when the
+ // underlying QObject is deleted. At that point any interaction with the QQmlData is UB
+ // anyway. So, for all intents and purposese, the list becomes non-null once and then stays
+ // non-null "forever". We can apply relaxed semantics.
+ notifyList.storeRelaxed(list);
}
Q_ASSERT(!endpoint->isConnected());
index = qMin(index, 0xFFFF - 1);
- notifyList->connectionMask |= (1ULL << quint64(index % 64));
- if (index < notifyList->notifiesSize) {
+ // Likewise, we don't really care _when_ the change in the connectionMask is propagated to other
+ // threads. Cross-thread event ordering is inherently nondeterministic. Therefore, when querying
+ // the conenctionMask in the presence of concurrent modification, any result is correct.
+ list->connectionMask.storeRelaxed(
+ list->connectionMask.loadRelaxed() | (1ULL << quint64(index % 64)));
- endpoint->next = notifyList->notifies[index];
+ if (index < list->notifiesSize) {
+ endpoint->next = list->notifies[index];
if (endpoint->next) endpoint->next->prev = &endpoint->next;
- endpoint->prev = &notifyList->notifies[index];
- notifyList->notifies[index] = endpoint;
-
+ endpoint->prev = &list->notifies[index];
+ list->notifies[index] = endpoint;
} else {
- notifyList->maximumTodoIndex = qMax(int(notifyList->maximumTodoIndex), index);
+ list->maximumTodoIndex = qMax(int(list->maximumTodoIndex), index);
- endpoint->next = notifyList->todo;
+ endpoint->next = list->todo;
if (endpoint->next) endpoint->next->prev = &endpoint->next;
- endpoint->prev = &notifyList->todo;
- notifyList->todo = endpoint;
+ endpoint->prev = &list->todo;
+ list->todo = endpoint;
}
}
-void QQmlData::disconnectNotifiers()
+void QQmlData::disconnectNotifiers(QQmlData::DeleteNotifyList doDelete)
{
- if (notifyList) {
- while (notifyList->todo)
- notifyList->todo->disconnect();
- for (int ii = 0; ii < notifyList->notifiesSize; ++ii) {
- while (QQmlNotifierEndpoint *ep = notifyList->notifies[ii])
+ // Can only happen on "home" thread. We apply relaxed semantics when loading the atomics.
+ if (NotifyList *list = notifyList.loadRelaxed()) {
+ while (QQmlNotifierEndpoint *todo = list->todo)
+ todo->disconnect();
+ for (int ii = 0; ii < list->notifiesSize; ++ii) {
+ while (QQmlNotifierEndpoint *ep = list->notifies[ii])
ep->disconnect();
}
- free(notifyList->notifies);
- free(notifyList);
- notifyList = nullptr;
+ free(list->notifies);
+
+ if (doDelete == DeleteNotifyList::Yes) {
+ // We can only get here from QQmlData::destroyed(), and that can only come from the
+ // the QObject dtor. If you're still sending signals at that point you have UB already
+ // without any threads. Therefore, it's enough to apply relaxed semantics.
+ notifyList.storeRelaxed(nullptr);
+ delete list;
+ } else {
+ // We can use relaxed semantics here. The worst thing that can happen is that some
+ // signal is falsely reported as connected. Signal connectedness across threads
+ // is not quite deterministic anyway.
+ list->connectionMask.storeRelaxed(0);
+ list->maximumTodoIndex = 0;
+ list->notifiesSize = 0;
+ list->notifies = nullptr;
+
+ }
}
}
@@ -1958,7 +1985,7 @@ void QQmlData::destroyed(QObject *object)
guard->objectDestroyed(object);
}
- disconnectNotifiers();
+ disconnectNotifiers(DeleteNotifyList::Yes);
if (extendedData)
delete extendedData;
--
2.41.0

View File

@ -0,0 +1,116 @@
From 1b0e366092bcfae0392592c3b7891f0e47af1018 Mon Sep 17 00:00:00 2001
From: Oliver Eftevaag <oliver.eftevaag@qt.io>
Date: Fri, 9 Dec 2022 18:40:54 +0100
Subject: [PATCH 30/30] Flickable: prevent fixup() from being called while
dragging
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
A previous patch 5647527a8cde84b51fff66fc482f02435770b3dd causes
a regression. The purpose of the patch, that caused this regression,
was to update the pressPos variables, in cases where the contentItem's
geometry was modified externally, while a user were dragging the
contentItem around.
The mistake that was made, was how width and height changes were
handled. We had previously added logic in setContentWidth() and
setContentHeight() that would call fixup() (with immediate fixupMode)
to ensure that the contentItem would immediately be repositioned
inside the flickable's viewport, if the contentItem was being dragged.
It turns out that setContentWidth() and setContentHeight() are being
called from QQuickItemViewPrivate::updateViewport(), which happens
quite often, while dragging. This would make fixup() and dragging
constantly interfere with each other, since they'd not always agree on
a specific position for the contentItem.
This patch reverts the changes made to setContentWidth() and
setContentHeight(), since it turns out that those changes weren't
necessary after all. QQuickFlickablePrivate::itemGeometryChanged() only
calls viewportMoved() on x and y changes anyways.
Done-with: Jan Arve Sæther <jan-arve.saether@qt.io>
Done-with: Santhosh Kumar Selvaraj <santhosh.kumar.selvaraj@qt.io>
Fixes: QTBUG-109140
Pick-to: 5.15 6.2 6.3 6.4 6.5
Change-Id: I0bddf8685d3afc1ae04b2c092212d3c1bd742c3b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit b307bf3c4f63c6e04874a972c747f18e18ddc199)
---
src/quick/items/qquickflickable.cpp | 8 ++------
src/quick/items/qquickflickable_p_p.h | 1 +
tests/auto/quick/qquickflickable/tst_qquickflickable.cpp | 8 +++++++-
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index ea357d819d..2634b68248 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -2120,11 +2120,9 @@ void QQuickFlickable::setContentWidth(qreal w)
d->contentItem->setWidth(w);
d->hData.markExtentsDirty();
// Make sure that we're entirely in view.
- if ((!d->pressed && !d->hData.moving && !d->vData.moving) || d->hData.dragging) {
- d->hData.contentPositionChangedExternallyDuringDrag = d->hData.dragging;
+ if (!d->pressed && !d->hData.moving && !d->vData.moving) {
d->fixupMode = QQuickFlickablePrivate::Immediate;
d->fixupX();
- d->hData.contentPositionChangedExternallyDuringDrag = false;
} else if (!d->pressed && d->hData.fixingUp) {
d->fixupMode = QQuickFlickablePrivate::ExtentChanged;
d->fixupX();
@@ -2151,11 +2149,9 @@ void QQuickFlickable::setContentHeight(qreal h)
d->contentItem->setHeight(h);
d->vData.markExtentsDirty();
// Make sure that we're entirely in view.
- if ((!d->pressed && !d->hData.moving && !d->vData.moving) || d->vData.dragging) {
- d->vData.contentPositionChangedExternallyDuringDrag = d->vData.dragging;
+ if (!d->pressed && !d->hData.moving && !d->vData.moving) {
d->fixupMode = QQuickFlickablePrivate::Immediate;
d->fixupY();
- d->vData.contentPositionChangedExternallyDuringDrag = false;
} else if (!d->pressed && d->vData.fixingUp) {
d->fixupMode = QQuickFlickablePrivate::ExtentChanged;
d->fixupY();
diff --git a/src/quick/items/qquickflickable_p_p.h b/src/quick/items/qquickflickable_p_p.h
index d5d838eaea..aef15e150a 100644
--- a/src/quick/items/qquickflickable_p_p.h
+++ b/src/quick/items/qquickflickable_p_p.h
@@ -120,6 +120,7 @@ public:
dragStartOffset = 0;
fixingUp = false;
inOvershoot = false;
+ contentPositionChangedExternallyDuringDrag = false;
}
void markExtentsDirty() {
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index d092cd0170..62f7c67dd4 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -2642,7 +2642,12 @@ void tst_qquickflickable::setContentPositionWhileDragging() // QTBUG-104966
} else if (newExtent >= 0) {
// ...or reduce the content size be be less than current (contentX, contentY) position
// This forces the content item to move.
- expectedContentPos = moveDelta;
+ // contentY: 150
+ // 320 - 150 = 170 pixels down to bottom
+ // Now reduce contentHeight to 200
+ // since we are at the bottom, and the flickable is 100 pixels tall, contentY must land
+ // at newExtent - 100.
+
if (isHorizontal) {
flickable->setContentWidth(newExtent);
} else {
@@ -2652,6 +2657,7 @@ void tst_qquickflickable::setContentPositionWhileDragging() // QTBUG-104966
// We therefore cannot scroll/flick it further down. Drag it up towards the top instead
// (by moving mouse down).
pos += moveDelta;
+ expectedContentPos = unitDelta * (newExtent - (isHorizontal ? flickable->width() : flickable->height()));
}
QTest::mouseMove(window.data(), pos);
--
2.41.0

View File

@ -11,8 +11,8 @@
Summary: Qt5 - QtDeclarative component
Name: qt5-%{qt_module}
Version: 5.15.10
Release: 2%{?dist}
Version: 5.15.11
Release: 1%{?dist}
# See LICENSE.GPL LICENSE.LGPL LGPL_EXCEPTION.txt, for details
License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0
@ -27,42 +27,43 @@ Source5: qv4global_p-multilib.h
## upstream patches
## repo: https://invent.kde.org/qt/qt/qtdeclarative
## branch: kde/5.15
## git format-patch v5.15.10-lts-lgpl
Patch1: 0001-Remove-unused-QPointer-QQuickPointerMask.patch
Patch2: 0002-QQmlDelegateModel-Refresh-the-view-when-a-column-is-.patch
Patch3: 0003-Fix-TapHandler-so-that-it-actually-registers-a-tap.patch
Patch4: 0004-Revert-Fix-TapHandler-so-that-it-actually-registers-.patch
Patch5: 0005-Make-sure-QQuickWidget-and-its-offscreen-window-s-sc.patch
Patch6: 0006-QQuickItem-Guard-against-cycles-in-nextPrevItemInTab.patch
Patch7: 0007-Don-t-convert-QByteArray-in-startDrag.patch
Patch8: 0008-Fix-build-after-95290f66b806a307b8da1f72f8fc2c698019.patch
Patch9: 0009-Implement-accessibility-for-QQuickWidget.patch
Patch10: 0010-Send-ObjectShow-event-for-visible-components-after-i.patch
Patch11: 0011-QQuickItem-avoid-emitting-signals-during-destruction.patch
Patch12: 0012-a11y-track-item-enabled-state.patch
Patch13: 0013-Make-QaccessibleQuickWidget-private-API.patch
Patch14: 0014-Qml-Don-t-crash-when-as-casting-to-type-with-errors.patch
Patch15: 0015-Fix-missing-glyphs-when-using-NativeRendering.patch
Patch16: 0016-Revert-Fix-missing-glyphs-when-using-NativeRendering.patch
Patch17: 0017-QQmlImportDatabase-Make-sure-the-newly-added-import-.patch
Patch18: 0018-QQuickState-when-handle-QJSValue-properties-correctl.patch
Patch19: 0019-Models-Avoid-crashes-when-deleting-cache-items.patch
Patch20: 0020-qv4function-Fix-crash-due-to-reference-being-invalid.patch
Patch21: 0021-Quick-Animations-Fix-crash.patch
Patch22: 0022-Prevent-crash-when-destroying-asynchronous-Loader.patch
Patch23: 0023-QQuickItem-Fix-effective-visibility-for-items-withou.patch
Patch24: 0024-Revert-QQuickItem-Fix-effective-visibility-for-items.patch
Patch25: 0025-Accessibility-respect-value-in-attached-Accessible-i.patch
Patch26: 0026-qml-tool-Use-QCommandLineParser-process-rather-than-.patch
## git format-patch v5.15.11-lts-lgpl
Patch1: 0001-Remove-unused-QPointer-QQuickPointerMask.patch
Patch2: 0002-QQmlDelegateModel-Refresh-the-view-when-a-column-is-.patch
Patch3: 0003-Fix-TapHandler-so-that-it-actually-registers-a-tap.patch
Patch4: 0004-Revert-Fix-TapHandler-so-that-it-actually-registers-.patch
Patch5: 0005-Make-sure-QQuickWidget-and-its-offscreen-window-s-sc.patch
Patch6: 0006-QQuickItem-Guard-against-cycles-in-nextPrevItemInTab.patch
Patch7: 0007-Don-t-convert-QByteArray-in-startDrag.patch
Patch8: 0008-Fix-build-after-95290f66b806a307b8da1f72f8fc2c698019.patch
Patch9: 0009-Implement-accessibility-for-QQuickWidget.patch
Patch10: 0010-Send-ObjectShow-event-for-visible-components-after-i.patch
Patch11: 0011-QQuickItem-avoid-emitting-signals-during-destruction.patch
Patch12: 0012-a11y-track-item-enabled-state.patch
Patch13: 0013-Make-QaccessibleQuickWidget-private-API.patch
Patch14: 0014-Qml-Don-t-crash-when-as-casting-to-type-with-errors.patch
Patch15: 0015-QQmlImportDatabase-Make-sure-the-newly-added-import-.patch
Patch16: 0016-QQuickState-when-handle-QJSValue-properties-correctl.patch
Patch17: 0017-Models-Avoid-crashes-when-deleting-cache-items.patch
Patch18: 0018-qv4function-Fix-crash-due-to-reference-being-invalid.patch
Patch19: 0019-Quick-Animations-Fix-crash.patch
Patch20: 0020-Prevent-crash-when-destroying-asynchronous-Loader.patch
Patch21: 0021-QQuickItem-Fix-effective-visibility-for-items-withou.patch
Patch22: 0022-Revert-QQuickItem-Fix-effective-visibility-for-items.patch
Patch23: 0023-Accessibility-respect-value-in-attached-Accessible-i.patch
Patch24: 0024-qml-tool-Use-QCommandLineParser-process-rather-than-.patch
Patch25: 0025-JIT-Add-missing-STORE-LOAD-_ACC-to-CreateCallContext.patch
Patch26: 0026-QQmlJs-MemoryPool-fix-potential-UB-pointer-overflow.patch
Patch27: 0027-QRecyclePool-fix-potential-UB.patch
Patch28: 0028-QtQml-Clean-up-QQmlData-ctor.patch
Patch29: 0029-QML-Make-notify-list-thread-safe.patch
Patch30: 0030-Flickable-prevent-fixup-from-being-called-while-drag.patch
## upstreamable patches
Patch100: %{name}-gcc11.patch
# https://pagure.io/fedora-kde/SIG/issue/82
Patch101: qtdeclarative-5.15.0-FixMaxXMaxYExtent.patch
# From: https://codereview.qt-project.org/c/qt/qtdeclarative/+/466808
# Cf. https://bugzilla.redhat.com/show_bug.cgi?id=2177696
Patch102: qt-QTBUG-111935-fix-V4-jit.patch
# filter qml provides
%global __provides_exclude_from ^%{_qt5_archdatadir}/qml/.*\\.so$
@ -240,6 +241,9 @@ make check -k -C tests ||:
%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 (qtdeclarative-everywhere-opensource-src-5.15.10.tar.xz) = 378fc41a31edb52d85fd5e37fe6c086e35b5d5d759ceacc49cf7981a8a38d25ae5f2ca27d99547bd1db381f32128e7947800e2a01a857177707cc2a9980373a8
SHA512 (qtdeclarative-everywhere-opensource-src-5.15.11.tar.xz) = 08f76c5a1253d6014e48ef8d8c53f65d3087efea0f614f36aa03f37882c6947109b17398ac491157c4fbd0c954762e819c2f074fa5a71e6990f16a54ec7224ae