update to version 5.15.10-1

(cherry picked from commit 7470737daf88b77b41bdabc178519bc4ba7a27f1)
This commit is contained in:
huayadong 2023-08-21 15:54:36 +08:00 committed by openeuler-sync-bot
parent 2204a7588b
commit 0eaee0887c
54 changed files with 2825 additions and 2414 deletions

View File

@ -0,0 +1,35 @@
From 7a8bd4c2b3213919343359d5933914ffe1d535e0 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>
Change-Id: I009fa6bbd8599dc3bb2e810176fe20e70ed50851
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit ac03b4b8ee9cc8d4522e0c8cf1018ff086f80c1b)
---
src/quick/items/qquickmousearea_p_p.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/quick/items/qquickmousearea_p_p.h b/src/quick/items/qquickmousearea_p_p.h
index fba383e268..0d63618622 100644
--- a/src/quick/items/qquickmousearea_p_p.h
+++ b/src/quick/items/qquickmousearea_p_p.h
@@ -61,7 +61,6 @@ QT_BEGIN_NAMESPACE
class QQuickMouseEvent;
class QQuickMouseArea;
-class QQuickPointerMask;
class QQuickMouseAreaPrivate : public QQuickItemPrivate
{
Q_DECLARE_PUBLIC(QQuickMouseArea)
@@ -100,7 +99,6 @@ public:
#if QT_CONFIG(quick_draganddrop)
QQuickDrag *drag;
#endif
- QPointer<QQuickPointerMask> mask;
QPointF startScene;
QPointF targetStartPos;
QPointF lastPos;
--
2.40.1

View File

@ -0,0 +1,178 @@
From 28c1d895c5220d7f5c49d18ae839feaac0f6e69f 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
added at 0
It can happen that a model reports n>0 rows but columns=0 (See
QConcatenateTablesProxyModel). In those cases we would render glitchy
items until the elements are marked as dirty.
Change-Id: I615c9cacbb1b6f9dee3898b03476605e5ac39d0a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit ec9251efb918f37971aeefa1f687d137d037ff12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Signed-off-by: Aleix Pol <aleixpol@kde.org>
---
src/qmlmodels/qqmldelegatemodel.cpp | 44 +++++++++++++++++++
src/qmlmodels/qqmldelegatemodel_p.h | 3 ++
.../data/redrawUponColumnChange.qml | 11 +++++
.../tst_qqmldelegatemodel.cpp | 27 ++++++++++++
4 files changed, 85 insertions(+)
create mode 100644 tests/auto/qml/qqmldelegatemodel/data/redrawUponColumnChange.qml
diff --git a/src/qmlmodels/qqmldelegatemodel.cpp b/src/qmlmodels/qqmldelegatemodel.cpp
index 4fcff70de6..4157899aa6 100644
--- a/src/qmlmodels/qqmldelegatemodel.cpp
+++ b/src/qmlmodels/qqmldelegatemodel.cpp
@@ -389,6 +389,12 @@ void QQmlDelegateModelPrivate::connectToAbstractItemModel()
q, QQmlDelegateModel, SLOT(_q_rowsRemoved(QModelIndex,int,int)));
qmlobject_connect(aim, QAbstractItemModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
q, QQmlDelegateModel, SLOT(_q_rowsAboutToBeRemoved(QModelIndex,int,int)));
+ qmlobject_connect(aim, QAbstractItemModel, SIGNAL(columnsInserted(QModelIndex,int,int)),
+ q, QQmlDelegateModel, SLOT(_q_columnsInserted(QModelIndex,int,int)));
+ qmlobject_connect(aim, QAbstractItemModel, SIGNAL(columnsRemoved(QModelIndex,int,int)),
+ q, QQmlDelegateModel, SLOT(_q_columnsRemoved(QModelIndex,int,int)));
+ qmlobject_connect(aim, QAbstractItemModel, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)),
+ q, QQmlDelegateModel, SLOT(_q_columnsMoved(QModelIndex,int,int,QModelIndex,int)));
qmlobject_connect(aim, QAbstractItemModel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
q, QQmlDelegateModel, SLOT(_q_dataChanged(QModelIndex,QModelIndex,QVector<int>)));
qmlobject_connect(aim, QAbstractItemModel, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
@@ -413,6 +419,12 @@ void QQmlDelegateModelPrivate::disconnectFromAbstractItemModel()
q, SLOT(_q_rowsAboutToBeRemoved(QModelIndex,int,int)));
QObject::disconnect(aim, SIGNAL(rowsRemoved(QModelIndex,int,int)),
q, SLOT(_q_rowsRemoved(QModelIndex,int,int)));
+ QObject::disconnect(aim, SIGNAL(columnsInserted(QModelIndex,int,int)), q,
+ SLOT(_q_columnsInserted(QModelIndex,int,int)));
+ QObject::disconnect(aim, SIGNAL(columnsRemoved(QModelIndex,int,int)), q,
+ SLOT(_q_columnsRemoved(QModelIndex,int,int)));
+ QObject::disconnect(aim, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)), q,
+ SLOT(_q_columnsMoved(QModelIndex,int,int,QModelIndex,int)));
QObject::disconnect(aim, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
q, SLOT(_q_dataChanged(QModelIndex,QModelIndex,QVector<int>)));
QObject::disconnect(aim, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
@@ -1974,6 +1986,38 @@ void QQmlDelegateModel::_q_rowsMoved(
}
}
+void QQmlDelegateModel::_q_columnsInserted(const QModelIndex &parent, int begin, int end)
+{
+ Q_D(QQmlDelegateModel);
+ Q_UNUSED(end);
+ if (parent == d->m_adaptorModel.rootIndex && begin == 0) {
+ // mark all items as changed
+ _q_itemsChanged(0, d->m_count, QVector<int>());
+ }
+}
+
+void QQmlDelegateModel::_q_columnsRemoved(const QModelIndex &parent, int begin, int end)
+{
+ Q_D(QQmlDelegateModel);
+ Q_UNUSED(end);
+ if (parent == d->m_adaptorModel.rootIndex && begin == 0) {
+ // mark all items as changed
+ _q_itemsChanged(0, d->m_count, QVector<int>());
+ }
+}
+
+void QQmlDelegateModel::_q_columnsMoved(const QModelIndex &parent, int start, int end,
+ const QModelIndex &destination, int column)
+{
+ Q_D(QQmlDelegateModel);
+ Q_UNUSED(end);
+ if ((parent == d->m_adaptorModel.rootIndex && start == 0)
+ || (destination == d->m_adaptorModel.rootIndex && column == 0)) {
+ // mark all items as changed
+ _q_itemsChanged(0, d->m_count, QVector<int>());
+ }
+}
+
void QQmlDelegateModel::_q_dataChanged(const QModelIndex &begin, const QModelIndex &end, const QVector<int> &roles)
{
Q_D(QQmlDelegateModel);
diff --git a/src/qmlmodels/qqmldelegatemodel_p.h b/src/qmlmodels/qqmldelegatemodel_p.h
index 8aab4badca..d140bfbaaf 100644
--- a/src/qmlmodels/qqmldelegatemodel_p.h
+++ b/src/qmlmodels/qqmldelegatemodel_p.h
@@ -152,6 +152,9 @@ private Q_SLOTS:
void _q_itemsMoved(int from, int to, int count);
void _q_modelReset();
void _q_rowsInserted(const QModelIndex &,int,int);
+ void _q_columnsInserted(const QModelIndex &, int, int);
+ void _q_columnsRemoved(const QModelIndex &, int, int);
+ void _q_columnsMoved(const QModelIndex &, int, int, const QModelIndex &, int);
void _q_rowsAboutToBeRemoved(const QModelIndex &parent, int begin, int end);
void _q_rowsRemoved(const QModelIndex &,int,int);
void _q_rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int);
diff --git a/tests/auto/qml/qqmldelegatemodel/data/redrawUponColumnChange.qml b/tests/auto/qml/qqmldelegatemodel/data/redrawUponColumnChange.qml
new file mode 100644
index 0000000000..206133bb39
--- /dev/null
+++ b/tests/auto/qml/qqmldelegatemodel/data/redrawUponColumnChange.qml
@@ -0,0 +1,11 @@
+import QtQuick 2.8
+
+ListView {
+ id: root
+ width: 200
+ height: 200
+
+ delegate: Text {
+ text: display
+ }
+}
diff --git a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
index 35f1e2c94d..1722447830 100644
--- a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
+++ b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
@@ -27,6 +27,8 @@
****************************************************************************/
#include <QtTest/qtest.h>
+#include <QtCore/QConcatenateTablesProxyModel>
+#include <QtGui/QStandardItemModel>
#include <QtQml/qqmlcomponent.h>
#include <QtQmlModels/private/qqmldelegatemodel_p.h>
#include <QtQuick/qquickview.h>
@@ -47,6 +49,7 @@ private slots:
void filterOnGroup_removeWhenCompleted();
void qtbug_86017();
void contextAccessedByHandler();
+ void redrawUponColumnChange();
};
class AbstractItemModel : public QAbstractItemModel
@@ -186,6 +189,30 @@ void tst_QQmlDelegateModel::contextAccessedByHandler()
QVERIFY(root->property("works").toBool());
}
+void tst_QQmlDelegateModel::redrawUponColumnChange()
+{
+ QStandardItemModel m1;
+ m1.appendRow({
+ new QStandardItem("Banana"),
+ new QStandardItem("Coconut"),
+ });
+
+ QQuickView view(testFileUrl("redrawUponColumnChange.qml"));
+ QCOMPARE(view.status(), QQuickView::Ready);
+ view.show();
+ QQuickItem *root = view.rootObject();
+ root->setProperty("model", QVariant::fromValue<QObject *>(&m1));
+
+ QObject *item = root->property("currentItem").value<QObject *>();
+ QVERIFY(item);
+ QCOMPARE(item->property("text").toString(), "Banana");
+
+ QVERIFY(root);
+ m1.removeColumn(0);
+
+ QCOMPARE(item->property("text").toString(), "Coconut");
+}
+
QTEST_MAIN(tst_QQmlDelegateModel)
#include "tst_qqmldelegatemodel.moc"
--
2.40.1

View File

@ -0,0 +1,73 @@
From ac46066b113c8c8b93277f717dd2f90207ed0e85 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
This bug caused all quick examples that used the
shared\LauncherList.qml to be broken.
In QtGui, QSinglePointEvent will construct itself with a point id of 0
if there is a valid point, and with a point id of -1 if the point is
invalid (the default constructor does the latter).
However, QQuickSinglePointHandler::wantsPointerEvent() did not agree
with that, because it assumed that a point id of 0 meant
uninitialized/invalid point.
The fix is to change QQuickSinglePointHandler::wantsPointerEvent() and
QQuickHandlerPoint so that it assumes that the id -1 is now an invalid
point, (instead of 0)
Change-Id: I8c9683dfe06ebb77c5342a26f08174b67e7cbd90
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 8d3a91016506fd0afedb0be535f7c34a4ca762f6)
---
src/quick/handlers/qquickhandlerpoint.cpp | 4 ++--
src/quick/handlers/qquicksinglepointhandler.cpp | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/quick/handlers/qquickhandlerpoint.cpp b/src/quick/handlers/qquickhandlerpoint.cpp
index 7103206470..02141b9a9e 100644
--- a/src/quick/handlers/qquickhandlerpoint.cpp
+++ b/src/quick/handlers/qquickhandlerpoint.cpp
@@ -82,7 +82,7 @@ void QQuickHandlerPoint::localize(QQuickItem *item)
void QQuickHandlerPoint::reset()
{
- m_id = 0;
+ m_id = -1;
m_uniqueId = QPointingDeviceUniqueId();
m_position = QPointF();
m_scenePosition = QPointF();
@@ -165,7 +165,7 @@ void QQuickHandlerPoint::reset(const QVector<QQuickHandlerPoint> &points)
pressureSum += point.pressure();
ellipseDiameterSum += point.ellipseDiameters();
}
- m_id = 0;
+ m_id = -1;
m_uniqueId = QPointingDeviceUniqueId();
// all points are required to be from the same event, so pressed buttons and modifiers should be the same
m_pressedButtons = points.first().pressedButtons();
diff --git a/src/quick/handlers/qquicksinglepointhandler.cpp b/src/quick/handlers/qquicksinglepointhandler.cpp
index d785d8c0ca..a508de455d 100644
--- a/src/quick/handlers/qquicksinglepointhandler.cpp
+++ b/src/quick/handlers/qquicksinglepointhandler.cpp
@@ -75,7 +75,7 @@ bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event)
if (!QQuickPointerDeviceHandler::wantsPointerEvent(event))
return false;
- if (d->pointInfo.id()) {
+ if (d->pointInfo.id() != -1) {
// We already know which one we want, so check whether it's there.
// It's expected to be an update or a release.
// If we no longer want it, cancel the grab.
@@ -125,7 +125,7 @@ bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event)
chosen->setAccepted();
}
}
- return d->pointInfo.id();
+ return d->pointInfo.id() != -1;
}
void QQuickSinglePointHandler::handlePointerEventImpl(QQuickPointerEvent *event)
--
2.40.1

View File

@ -0,0 +1,61 @@
From d6514d71fe897493e76bd5e38bccf9b9159c4880 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
tap"
This reverts commit 36e8ccd434f948e4f11a8f9d59139ec072e41ff5.
It's causing regresions
---
src/quick/handlers/qquickhandlerpoint.cpp | 4 ++--
src/quick/handlers/qquicksinglepointhandler.cpp | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/quick/handlers/qquickhandlerpoint.cpp b/src/quick/handlers/qquickhandlerpoint.cpp
index 02141b9a9e..7103206470 100644
--- a/src/quick/handlers/qquickhandlerpoint.cpp
+++ b/src/quick/handlers/qquickhandlerpoint.cpp
@@ -82,7 +82,7 @@ void QQuickHandlerPoint::localize(QQuickItem *item)
void QQuickHandlerPoint::reset()
{
- m_id = -1;
+ m_id = 0;
m_uniqueId = QPointingDeviceUniqueId();
m_position = QPointF();
m_scenePosition = QPointF();
@@ -165,7 +165,7 @@ void QQuickHandlerPoint::reset(const QVector<QQuickHandlerPoint> &points)
pressureSum += point.pressure();
ellipseDiameterSum += point.ellipseDiameters();
}
- m_id = -1;
+ m_id = 0;
m_uniqueId = QPointingDeviceUniqueId();
// all points are required to be from the same event, so pressed buttons and modifiers should be the same
m_pressedButtons = points.first().pressedButtons();
diff --git a/src/quick/handlers/qquicksinglepointhandler.cpp b/src/quick/handlers/qquicksinglepointhandler.cpp
index a508de455d..d785d8c0ca 100644
--- a/src/quick/handlers/qquicksinglepointhandler.cpp
+++ b/src/quick/handlers/qquicksinglepointhandler.cpp
@@ -75,7 +75,7 @@ bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event)
if (!QQuickPointerDeviceHandler::wantsPointerEvent(event))
return false;
- if (d->pointInfo.id() != -1) {
+ if (d->pointInfo.id()) {
// We already know which one we want, so check whether it's there.
// It's expected to be an update or a release.
// If we no longer want it, cancel the grab.
@@ -125,7 +125,7 @@ bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event)
chosen->setAccepted();
}
}
- return d->pointInfo.id() != -1;
+ return d->pointInfo.id();
}
void QQuickSinglePointHandler::handlePointerEventImpl(QQuickPointerEvent *event)
--
2.40.1

View File

@ -0,0 +1,84 @@
From b02c8610176e1d1ceb65ac5d832d3a21c5a79d47 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
screens are always in sync
By default, the offscreen window is placed on the primary screen.
However, if the parent widget argument is passed to the QQuickWidget's
constructor, then QQuickWidget's and the offscreen window's screens can
be different and that can create rendering issues, e.g. blurry text if
the primary screen and QQuickWidget's screen have different scale
factors.
Change-Id: I10c62b5635664f943b11828773f14017f198a770
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit a2a2734bffa1459639b31fb3f4f83873ba44ab5c)
---
src/quickwidgets/qquickwidget.cpp | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 39780f8de3..223d91f579 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -106,6 +106,7 @@ void QQuickWidgetPrivate::init(QQmlEngine* e)
renderControl = new QQuickWidgetRenderControl(q);
offscreenWindow = new QQuickWindow(*new QQuickOffcreenWindowPrivate(),renderControl);
+ offscreenWindow->setScreen(q->screen());
offscreenWindow->setTitle(QString::fromLatin1("Offscreen"));
offscreenWindow->setObjectName(QString::fromLatin1("QQuickOffScreenWindow"));
// Do not call create() on offscreenWindow.
@@ -901,9 +902,7 @@ void QQuickWidgetPrivate::createContext()
context = new QOpenGLContext;
context->setFormat(offscreenWindow->requestedFormat());
- const QWindow *win = q->window()->windowHandle();
- if (win && win->screen())
- context->setScreen(win->screen());
+ context->setScreen(q->screen());
QOpenGLContext *shareContext = qt_gl_global_share_context();
if (!shareContext)
shareContext = QWidgetPrivate::get(q->window())->shareContext();
@@ -1520,19 +1519,16 @@ bool QQuickWidget::event(QEvent *e)
d->handleWindowChange();
break;
- case QEvent::ScreenChangeInternal:
- if (QWindow *window = this->window()->windowHandle()) {
- QScreen *newScreen = window->screen();
-
- if (d->offscreenWindow)
- d->offscreenWindow->setScreen(newScreen);
- if (d->offscreenSurface)
- d->offscreenSurface->setScreen(newScreen);
+ case QEvent::ScreenChangeInternal: {
+ QScreen *newScreen = screen();
+ if (d->offscreenWindow)
+ d->offscreenWindow->setScreen(newScreen);
+ if (d->offscreenSurface)
+ d->offscreenSurface->setScreen(newScreen);
#if QT_CONFIG(opengl)
- if (d->context)
- d->context->setScreen(newScreen);
+ if (d->context)
+ d->context->setScreen(newScreen);
#endif
- }
if (d->useSoftwareRenderer
#if QT_CONFIG(opengl)
@@ -1545,7 +1541,7 @@ bool QQuickWidget::event(QEvent *e)
d->render(true);
}
break;
-
+ }
case QEvent::Show:
case QEvent::Move:
d->updatePosition();
--
2.40.1

View File

@ -1,51 +0,0 @@
From 4ee1462686dc12eb463f5ba6b378d43a39aed074 Mon Sep 17 00:00:00 2001
From: Fabian Kosmale <fabian.kosmale@qt.io>
Date: Thu, 12 Nov 2020 12:11:29 +0100
Subject: [PATCH 05/28] QQuickView docs: show correct usage of
setInitialProperties
Change-Id: If63f4c59f18bc0754ce2e68e424f6efd0f512d30
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 54d4f8f526f9c9a1af702b14925e1d34ee8b2134)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
src/quick/doc/snippets/qquickview-ex.cpp | 9 +++++++++
src/quick/items/qquickview.cpp | 4 ++++
2 files changed, 13 insertions(+)
diff --git a/src/quick/doc/snippets/qquickview-ex.cpp b/src/quick/doc/snippets/qquickview-ex.cpp
index 32406f8f2f..5f93dfdbe8 100644
--- a/src/quick/doc/snippets/qquickview-ex.cpp
+++ b/src/quick/doc/snippets/qquickview-ex.cpp
@@ -59,3 +59,12 @@ int main(int argc, char *argv[])
return app.exec();
}
//![0]
+
+void makeDocTeamHappyByKeepingExampleCompilable() {
+//![1]
+ QScopedPointer<QQuickView> view { new QQuickView };
+ view->setInitialProperties({"x, 100"}, {"width", 50});
+ view->setSource(QUrl::fromLocalFile("myqmlfile.qml"));
+ view->show();
+//![1]
+}
diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp
index 97f6689d8a..b3a5270e9b 100644
--- a/src/quick/items/qquickview.cpp
+++ b/src/quick/items/qquickview.cpp
@@ -240,7 +240,11 @@ void QQuickView::setSource(const QUrl& url)
Sets the initial properties \a initialProperties with which the QML
component gets initialized after calling \l QQuickView::setSource().
+ \snippet qquickview-ex.cpp 1
+
\note You can only use this function to initialize top-level properties.
+ \note This function should always be called before setSource, as it has
+ no effect once the component has become \c Ready.
\sa QQmlComponent::createWithInitialProperties()
\since 5.14
--
2.31.1

View File

@ -0,0 +1,122 @@
From d1d910545103549912d1b51383a5ace872dfb1f8 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
nextPrevItemInTabFocusChain
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
nextPrevItemInTabFocusChain already had a check to prevent running into
cycles, it would however only detect if we reached the original item. If
our cycle instead would loop between reachable items without ever
returning to the initial one, as in the diagram below, then we would
never terminate the loop.
/-->other item<---next item
initial-item \ ^
\ |
--->different item
To prevent this from happening, we keep track of all items we've seen so
far. One last complications arises due to the fact that we do visit the
parent twice under some cicrcumstances, but we already have the skip
variable to indicate that case we simply skip the duplicate check if
it is set to true.
Pick-to: 6.2 6.3
Fixes: QTBUG-87190
Change-Id: I1449a7ebf8f325f00c296e8a8db4360faf1049e4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e74bcf751495d9fe27efd195bc04e2a6ae6732a4)
---
src/quick/items/qquickitem.cpp | 7 ++++++-
.../data/activeFocusOnTab_infiniteLoop3.qml | 13 +++++++++++++
tests/auto/quick/qquickitem2/tst_qquickitem.cpp | 12 ++++++++++++
3 files changed, 31 insertions(+), 1 deletion(-)
create mode 100644 tests/auto/quick/qquickitem2/data/activeFocusOnTab_infiniteLoop3.qml
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 33da9762d3..ec55fb2998 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -59,6 +59,7 @@
#include <QtCore/private/qnumeric_p.h>
#include <QtGui/qpa/qplatformtheme.h>
#include <QtCore/qloggingcategory.h>
+#include <QtCore/private/qduplicatetracker_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qqmlengine_p.h>
@@ -2526,6 +2527,7 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo
QQuickItem *current = item;
qCDebug(DBG_FOCUS) << "QQuickItemPrivate::nextPrevItemInTabFocusChain: startItem:" << startItem;
qCDebug(DBG_FOCUS) << "QQuickItemPrivate::nextPrevItemInTabFocusChain: firstFromItem:" << firstFromItem;
+ QDuplicateTracker<QQuickItem *> cycleDetector;
do {
qCDebug(DBG_FOCUS) << "QQuickItemPrivate::nextPrevItemInTabFocusChain: current:" << current;
qCDebug(DBG_FOCUS) << "QQuickItemPrivate::nextPrevItemInTabFocusChain: from:" << from;
@@ -2592,7 +2594,10 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo
// traversed all of the chain (by compare the [current] item with [startItem])
// Since the [startItem] might be promoted to its parent if it is invisible,
// we still have to check [current] item with original start item
- if ((current == startItem || current == originalStartItem) && from == firstFromItem) {
+ // We might also run into a cycle before we reach firstFromItem again
+ // but note that we have to ignore current if we are meant to skip it
+ if (((current == startItem || current == originalStartItem) && from == firstFromItem) ||
+ (!skip && cycleDetector.hasSeen(current))) {
// wrapped around, avoid endless loops
if (item == contentItem) {
qCDebug(DBG_FOCUS) << "QQuickItemPrivate::nextPrevItemInTabFocusChain: looped, return contentItem";
diff --git a/tests/auto/quick/qquickitem2/data/activeFocusOnTab_infiniteLoop3.qml b/tests/auto/quick/qquickitem2/data/activeFocusOnTab_infiniteLoop3.qml
new file mode 100644
index 0000000000..889e480f3b
--- /dev/null
+++ b/tests/auto/quick/qquickitem2/data/activeFocusOnTab_infiniteLoop3.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.6
+
+Item {
+ visible: true
+ Item {
+ visible: false
+ Item {
+ objectName: "hiddenChild"
+ activeFocusOnTab: true
+ focus: true
+ }
+ }
+}
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index c8f251dbe1..c8ef36ee68 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -67,6 +67,7 @@ private slots:
void activeFocusOnTab10();
void activeFocusOnTab_infiniteLoop_data();
void activeFocusOnTab_infiniteLoop();
+ void activeFocusOnTab_infiniteLoopControls();
void nextItemInFocusChain();
void nextItemInFocusChain2();
@@ -1057,6 +1058,17 @@ void tst_QQuickItem::activeFocusOnTab_infiniteLoop()
QCOMPARE(item, window->rootObject());
}
+
+void tst_QQuickItem::activeFocusOnTab_infiniteLoopControls()
+{
+ auto source = testFileUrl("activeFocusOnTab_infiniteLoop3.qml");
+ QScopedPointer<QQuickView>window(new QQuickView());
+ window->setSource(source);
+ window->show();
+ QVERIFY(window->errors().isEmpty());
+ QTest::keyClick(window.get(), Qt::Key_Tab); // should not hang
+}
+
void tst_QQuickItem::nextItemInFocusChain()
{
if (!qt_tab_all_widgets())
--
2.40.1

View File

@ -1,43 +0,0 @@
From 81238e0ff8453f4fb78436ac9bec8452584680ae Mon Sep 17 00:00:00 2001
From: Bartlomiej Moskal <bartlomiej.moskal@siili.com>
Date: Thu, 5 Nov 2020 10:12:29 +0100
Subject: [PATCH 06/28] QQuickWindow: Check if QQuickItem was not deleted
Added check into deliverMatchingPointsToItem method for Android device.
In QT_VERSION below 6.0.0 touchEnabled for QtQuickItems is set by default to true
It causes delivering touch events to Items which are not interested
In some cases it may cause a crash. For example using Material Style in Android.
QQuickShaderEffectSource may be deleted and then try to handle touch
Fixes: QTBUG-85379
Change-Id: Ia2c4e016db57ef9c86fcc31d4cfba6154068a546
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit a14e4fcdf94d26774490b26a4ef77981594f583f)
Reviewed-by: Bartlomiej Moskal <bartlomiej.moskal@siili.com>
---
src/quick/items/qquickwindow.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index d0c9ad5454..9ff91eb9a0 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -2864,6 +2864,14 @@ void QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPo
{
Q_Q(QQuickWindow);
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
+#if defined(Q_OS_ANDROID) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ // QTBUG-85379
+ // In QT_VERSION below 6.0.0 touchEnabled for QtQuickItems is set by default to true
+ // It causes delivering touch events to Items which are not interested
+ // In some cases (like using Material Style in Android) it may cause a crash
+ if (itemPrivate->wasDeleted)
+ return;
+#endif
pointerEvent->localize(item);
// Let the Item's handlers (if any) have the event first.
--
2.31.1

View File

@ -1,271 +0,0 @@
From e749605ecbe76c392552d0e3a75f47b31bed9ba1 Mon Sep 17 00:00:00 2001
From: Kimmo Ollila <kimmo.ollila@qt.io>
Date: Wed, 11 Nov 2020 12:23:53 +0200
Subject: [PATCH 07/28] Avoid GHS linker to optimize away QML type
registrations
GHS linker optimizes away QML type registrations despite volatile.
To prevent this we add #pragma ghs reference(s) to avoid such linker
optimization.
Fixes: QTBUG-88033
Change-Id: I7c8983506360710185c37028873234b1464847d5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
---
src/imports/folderlistmodel/plugin.cpp | 1 +
src/imports/labsanimation/plugin.cpp | 1 +
src/imports/labsmodels/plugin.cpp | 1 +
src/imports/layouts/plugin.cpp | 1 +
src/imports/localstorage/plugin.cpp | 1 +
src/imports/settings/plugin.cpp | 1 +
src/imports/sharedimage/plugin.cpp | 1 +
src/imports/statemachine/plugin.cpp | 1 +
src/imports/testlib/main.cpp | 1 +
src/imports/wavefrontmesh/plugin.cpp | 1 +
src/imports/window/plugin.cpp | 1 +
src/particles/qtquickparticlesglobal_p.h | 1 +
src/qml/qml/qqmlextensionplugin.h | 7 +++++++
src/qml/qtqmlglobal_p.h | 2 ++
src/qmlmodels/qtqmlmodelsglobal_p.h | 1 +
src/qmlworkerscript/qtqmlworkerscriptglobal_p.h | 1 +
src/quick/qtquickglobal_p.h | 1 +
src/quickshapes/qquickshapesglobal_p.h | 2 ++
18 files changed, 26 insertions(+)
diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp
index 7a38769b77..7206df6664 100644
--- a/src/imports/folderlistmodel/plugin.cpp
+++ b/src/imports/folderlistmodel/plugin.cpp
@@ -43,6 +43,7 @@
#include "qquickfolderlistmodel.h"
extern void qml_register_types_Qt_labs_folderlistmodel();
+GHS_KEEP_REFERENCE(qml_register_types_Qt_labs_folderlistmodel);
QT_BEGIN_NAMESPACE
diff --git a/src/imports/labsanimation/plugin.cpp b/src/imports/labsanimation/plugin.cpp
index 9c985f0dcf..c35be764f9 100644
--- a/src/imports/labsanimation/plugin.cpp
+++ b/src/imports/labsanimation/plugin.cpp
@@ -43,6 +43,7 @@
#include "qquickboundaryrule_p.h"
extern void qml_register_types_Qt_labs_animation();
+GHS_KEEP_REFERENCE(qml_register_types_Qt_labs_animation);
QT_BEGIN_NAMESPACE
diff --git a/src/imports/labsmodels/plugin.cpp b/src/imports/labsmodels/plugin.cpp
index ab5e0023a6..b06491e663 100644
--- a/src/imports/labsmodels/plugin.cpp
+++ b/src/imports/labsmodels/plugin.cpp
@@ -51,6 +51,7 @@
#endif
extern void qml_register_types_Qt_labs_qmlmodels();
+GHS_KEEP_REFERENCE(qml_register_types_Qt_labs_qmlmodels);
QT_BEGIN_NAMESPACE
diff --git a/src/imports/layouts/plugin.cpp b/src/imports/layouts/plugin.cpp
index af270c1732..b6ae516eee 100644
--- a/src/imports/layouts/plugin.cpp
+++ b/src/imports/layouts/plugin.cpp
@@ -43,6 +43,7 @@
#include "qquickstacklayout_p.h"
extern void qml_register_types_QtQuick_Layouts();
+GHS_KEEP_REFERENCE(qml_register_types_QtQuick_Layouts);
QT_BEGIN_NAMESPACE
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index e488b3d43c..0291ed4715 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -43,6 +43,7 @@
#include <QtQml/qqml.h>
extern void qml_register_types_QtQuick_LocalStorage();
+GHS_KEEP_REFERENCE(qml_register_types_QtQuick_LocalStorage);
QT_BEGIN_NAMESPACE
diff --git a/src/imports/settings/plugin.cpp b/src/imports/settings/plugin.cpp
index e8e640412b..e83147f612 100644
--- a/src/imports/settings/plugin.cpp
+++ b/src/imports/settings/plugin.cpp
@@ -43,6 +43,7 @@
#include "qqmlsettings_p.h"
extern void qml_register_types_Qt_labs_settings();
+GHS_KEEP_REFERENCE(qml_register_types_Qt_labs_settings);
QT_BEGIN_NAMESPACE
diff --git a/src/imports/sharedimage/plugin.cpp b/src/imports/sharedimage/plugin.cpp
index d7c2ef8d17..79168d933b 100644
--- a/src/imports/sharedimage/plugin.cpp
+++ b/src/imports/sharedimage/plugin.cpp
@@ -100,6 +100,7 @@
*/
extern void qml_register_types_Qt_labs_sharedimage();
+GHS_KEEP_REFERENCE(qml_register_types_Qt_labs_sharedimage);
QT_BEGIN_NAMESPACE
diff --git a/src/imports/statemachine/plugin.cpp b/src/imports/statemachine/plugin.cpp
index c370504029..abb238965e 100644
--- a/src/imports/statemachine/plugin.cpp
+++ b/src/imports/statemachine/plugin.cpp
@@ -49,6 +49,7 @@
#include <qqml.h>
extern void qml_register_types_QtQml_StateMachine();
+GHS_KEEP_REFERENCE(qml_register_types_QtQml_StateMachine);
QT_BEGIN_NAMESPACE
diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp
index 83fc150e6c..1da251c49b 100644
--- a/src/imports/testlib/main.cpp
+++ b/src/imports/testlib/main.cpp
@@ -51,6 +51,7 @@ QML_DECLARE_TYPE(QuickTestEvent)
QML_DECLARE_TYPE(QuickTestUtil)
extern void qml_register_types_QtTest();
+GHS_KEEP_REFERENCE(qml_register_types_QtTest);
QT_BEGIN_NAMESPACE
diff --git a/src/imports/wavefrontmesh/plugin.cpp b/src/imports/wavefrontmesh/plugin.cpp
index eea0db19db..edd4d1dba5 100644
--- a/src/imports/wavefrontmesh/plugin.cpp
+++ b/src/imports/wavefrontmesh/plugin.cpp
@@ -43,6 +43,7 @@
#include "qwavefrontmesh.h"
extern void qml_register_types_Qt_labs_wavefrontmesh();
+GHS_KEEP_REFERENCE(qml_register_types_Qt_labs_wavefrontmesh);
QT_BEGIN_NAMESPACE
diff --git a/src/imports/window/plugin.cpp b/src/imports/window/plugin.cpp
index 5152fa02ec..ff2f10fde3 100644
--- a/src/imports/window/plugin.cpp
+++ b/src/imports/window/plugin.cpp
@@ -42,6 +42,7 @@
#include "plugin.h"
extern void qml_register_types_QtQuick_Window();
+GHS_KEEP_REFERENCE(qml_register_types_QtQuick_Window);
QT_BEGIN_NAMESPACE
diff --git a/src/particles/qtquickparticlesglobal_p.h b/src/particles/qtquickparticlesglobal_p.h
index 927bc29050..91c2764060 100644
--- a/src/particles/qtquickparticlesglobal_p.h
+++ b/src/particles/qtquickparticlesglobal_p.h
@@ -66,5 +66,6 @@
#endif
void Q_QUICKPARTICLES_PRIVATE_EXPORT qml_register_types_QtQuick_Particles();
+GHS_KEEP_REFERENCE(qml_register_types_QtQuick_Particles);
#endif // QTQUICKPARTICLESGLOBAL_P_H
diff --git a/src/qml/qml/qqmlextensionplugin.h b/src/qml/qml/qqmlextensionplugin.h
index ef7ff422cd..afb3f99c4a 100644
--- a/src/qml/qml/qqmlextensionplugin.h
+++ b/src/qml/qml/qqmlextensionplugin.h
@@ -44,6 +44,13 @@
#include <QtCore/QUrl>
#include <QtQml/qqmlextensioninterface.h>
+#if defined(Q_CC_GHS)
+# define GHS_PRAGMA(S) _Pragma(#S)
+# define GHS_KEEP_REFERENCE(S) GHS_PRAGMA(ghs reference S ##__Fv)
+#else
+# define GHS_KEEP_REFERENCE(S)
+#endif
+
QT_BEGIN_NAMESPACE
class QQmlEngine;
diff --git a/src/qml/qtqmlglobal_p.h b/src/qml/qtqmlglobal_p.h
index a729729b67..7b0910fa13 100644
--- a/src/qml/qtqmlglobal_p.h
+++ b/src/qml/qtqmlglobal_p.h
@@ -53,6 +53,7 @@
#include <QtCore/private/qglobal_p.h>
#include <QtQml/qtqmlglobal.h>
+#include <QtQml/qqmlextensionplugin.h>
#ifndef QT_QML_BOOTSTRAPPED
# include <QtQml/private/qtqml-config_p.h>
#endif
@@ -61,6 +62,7 @@
#define Q_QML_PRIVATE_EXPORT Q_QML_EXPORT
void Q_QML_PRIVATE_EXPORT qml_register_types_QtQml();
+GHS_KEEP_REFERENCE(qml_register_types_QtQml);
#if !defined(QT_QMLDEVTOOLS_LIB) && !defined(QT_BUILD_QMLDEVTOOLS_LIB)
# define Q_QML_AUTOTEST_EXPORT Q_AUTOTEST_EXPORT
diff --git a/src/qmlmodels/qtqmlmodelsglobal_p.h b/src/qmlmodels/qtqmlmodelsglobal_p.h
index 1a1157138d..24df6ef7b3 100644
--- a/src/qmlmodels/qtqmlmodelsglobal_p.h
+++ b/src/qmlmodels/qtqmlmodelsglobal_p.h
@@ -59,5 +59,6 @@
#define Q_QMLMODELS_AUTOTEST_EXPORT Q_AUTOTEST_EXPORT
void Q_QMLMODELS_PRIVATE_EXPORT qml_register_types_QtQml_Models();
+GHS_KEEP_REFERENCE(qml_register_types_QtQml_Models);
#endif // QTQMLMODELSGLOBAL_P_H
diff --git a/src/qmlworkerscript/qtqmlworkerscriptglobal_p.h b/src/qmlworkerscript/qtqmlworkerscriptglobal_p.h
index c75d5f3129..6452567f6b 100644
--- a/src/qmlworkerscript/qtqmlworkerscriptglobal_p.h
+++ b/src/qmlworkerscript/qtqmlworkerscriptglobal_p.h
@@ -58,5 +58,6 @@
#define Q_QMLWORKERSCRIPT_AUTOTEST_EXPORT Q_AUTOTEST_EXPORT
void Q_QMLWORKERSCRIPT_PRIVATE_EXPORT qml_register_types_QtQml_WorkerScript();
+GHS_KEEP_REFERENCE(qml_register_types_QtQml_WorkerScript);
#endif // QTQMLWORKERSCRIPTGLOBAL_P_H
diff --git a/src/quick/qtquickglobal_p.h b/src/quick/qtquickglobal_p.h
index 80e59563c7..97680569e7 100644
--- a/src/quick/qtquickglobal_p.h
+++ b/src/quick/qtquickglobal_p.h
@@ -62,6 +62,7 @@
#define Q_QUICK_PRIVATE_EXPORT Q_QUICK_EXPORT
void Q_QUICK_PRIVATE_EXPORT qml_register_types_QtQuick();
+GHS_KEEP_REFERENCE(qml_register_types_QtQuick);
QT_BEGIN_NAMESPACE
diff --git a/src/quickshapes/qquickshapesglobal_p.h b/src/quickshapes/qquickshapesglobal_p.h
index 40f6cfbdcf..37386c23b2 100644
--- a/src/quickshapes/qquickshapesglobal_p.h
+++ b/src/quickshapes/qquickshapesglobal_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtQml/qqmlextensionplugin.h>
#include "qquickshapesglobal.h"
QT_BEGIN_NAMESPACE
@@ -60,5 +61,6 @@ QT_BEGIN_NAMESPACE
QT_END_NAMESPACE
void Q_QUICKSHAPES_PRIVATE_EXPORT qml_register_types_QtQuick_Shapes();
+GHS_KEEP_REFERENCE(qml_register_types_QtQuick_Shapes);
#endif // QQUICKSHAPESGLOBAL_P_H
--
2.31.1

View File

@ -0,0 +1,60 @@
From 70a38e3c897e3ba72b50413d0f994c9f5ebaffd8 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`
QMimeData::setData expects the provided data to contain the correctly
encoded QByteArray, so if the variant contains a QByteArray, then take
it as is to avoid data loss.
If the variant is not already a byte array, then we ideally would make
sure that the mime type (i.e. the key of the map) and the QVariant's
type are compatible (image/png with a QImage works; text/plain with a
QImage does not). This changes behavior and needs to be a follow-up
commit.
Fixes: QTBUG-71922
Change-Id: I9b9f10fd332e1f9568f6835a69a1c359457f823c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 062f9bf57657b54dc708015ec5fed3c89e5cc3ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 22de23c4bb9ac5e2c545e9de3149a7d4f8edd5ee)
---
src/quick/items/qquickdrag.cpp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp
index 8321fcfeed..3b50370355 100644
--- a/src/quick/items/qquickdrag.cpp
+++ b/src/quick/items/qquickdrag.cpp
@@ -481,7 +481,9 @@ void QQuickDragAttached::setKeys(const QStringList &keys)
\qmlattachedproperty stringlist QtQuick::Drag::mimeData
\since 5.2
- This property holds a map of mimeData that is used during startDrag.
+ This property holds a map from mime type to data that is used during startDrag.
+ The mime data needs to be a \c string, or an \c ArrayBuffer with the data encoded
+ according to the mime type.
*/
QVariantMap QQuickDragAttached::mimeData() const
@@ -766,8 +768,12 @@ Qt::DropAction QQuickDragAttachedPrivate::startDrag(Qt::DropActions supportedAct
QDrag *drag = new QDrag(source ? source : q);
QMimeData *mimeData = new QMimeData();
- for (auto it = externalMimeData.cbegin(), end = externalMimeData.cend(); it != end; ++it)
- mimeData->setData(it.key(), it.value().toString().toUtf8());
+ for (auto it = externalMimeData.cbegin(), end = externalMimeData.cend(); it != end; ++it) {
+ if (it.value().typeId() == QMetaType::QByteArray)
+ mimeData->setData(it.key(), it.value().toByteArray());
+ else
+ mimeData->setData(it.key(), it.value().toString().toUtf8());
+ }
drag->setMimeData(mimeData);
if (pixmapLoader.isReady()) {
--
2.40.1

View File

@ -0,0 +1,26 @@
From 63d011a519c1fee2a0f5dbcc204def9e950a168b 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
95290f66b806a307b8da1f72f8fc2c69801933d0
---
src/quick/items/qquickdrag.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp
index 3b50370355..383078b3b9 100644
--- a/src/quick/items/qquickdrag.cpp
+++ b/src/quick/items/qquickdrag.cpp
@@ -769,7 +769,7 @@ Qt::DropAction QQuickDragAttachedPrivate::startDrag(Qt::DropActions supportedAct
QMimeData *mimeData = new QMimeData();
for (auto it = externalMimeData.cbegin(), end = externalMimeData.cend(); it != end; ++it) {
- if (it.value().typeId() == QMetaType::QByteArray)
+ if (static_cast<QMetaType::Type>(it.value().type()) == QMetaType::QByteArray)
mimeData->setData(it.key(), it.value().toByteArray());
else
mimeData->setData(it.key(), it.value().toString().toUtf8());
--
2.40.1

View File

@ -1,83 +0,0 @@
From f4afe4934819a7f0fb9754b9bb08fb1acb818058 Mon Sep 17 00:00:00 2001
From: Shinichi Okada <shinichi.okada@qt.io>
Date: Tue, 17 Nov 2020 14:15:50 +0900
Subject: [PATCH 08/28] QML Text doesn't reset lineCount when text is empty
lineCount is not reset when replacing a multi-line QML Text 'text'
property with an "" empty string. Also, the lineCountChanged signal is
not emitted
Task-number: QTBUG-84458
Change-Id: Ic3c02e6a90e6675eadbaafc6af6ab0356ee98123
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit ae1b9c6d94001411efeef600e22638906e0fa990)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
src/quick/items/qquicktext.cpp | 2 +
.../auto/quick/qquicktext/tst_qquicktext.cpp | 37 +++++++++++++++++++
2 files changed, 39 insertions(+)
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 90469ee82b..581ab9f76a 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -398,6 +398,8 @@ void QQuickTextPrivate::updateSize()
layedOutTextRect = QRectF(0, 0, 0, fontHeight);
advance = QSizeF();
signalSizeChange(previousSize);
+ lineCount = 1;
+ emit q->lineCountChanged();
updateType = UpdatePaintNode;
q->update();
return;
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index 42fdbea58d..308c6b5091 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -2243,6 +2243,43 @@ void tst_qquicktext::lineCount()
QCOMPARE(myText->lineCount(), 2);
QCOMPARE(myText->truncated(), true);
QCOMPARE(myText->maximumLineCount(), 2);
+
+ // QTBUG-84458
+ myText->resetMaximumLineCount();
+ myText->setText("qqqqq\nqqqqq");
+ QCOMPARE(myText->lineCount(), 2);
+ myText->setText("qqqqq\nqqqqq\nqqqqq");
+ QCOMPARE(myText->lineCount(), 3);
+ myText->setText("");
+ QCOMPARE(myText->lineCount(), 1);
+
+ myText->setText("qqqqq\nqqqqq\nqqqqq");
+ QCOMPARE(myText->lineCount(), 3);
+ myText->setFontSizeMode(QQuickText::HorizontalFit);
+ myText->setText("");
+ QCOMPARE(myText->lineCount(), 1);
+
+ myText->setText("qqqqq\nqqqqq\nqqqqq");
+ QCOMPARE(myText->lineCount(), 3);
+ myText->setFontSizeMode(QQuickText::VerticalFit);
+ myText->setText("");
+ QCOMPARE(myText->lineCount(), 1);
+
+ myText->setText("qqqqq\nqqqqq\nqqqqq");
+ QCOMPARE(myText->lineCount(), 3);
+ myText->setFontSizeMode(QQuickText::Fit);
+ myText->setText("");
+ QCOMPARE(myText->lineCount(), 1);
+
+ QScopedPointer<QQuickView> layoutWindow(createView(testFile("lineLayoutHAlign.qml")));
+ QQuickText *lineLaidOut = layoutWindow->rootObject()->findChild<QQuickText*>("myText");
+ QVERIFY(lineLaidOut != nullptr);
+
+ lineLaidOut->setText("qqqqq\nqqqqq\nqqqqq");
+ QCOMPARE(lineLaidOut->lineCount(), 3);
+ lineLaidOut->setFontSizeMode(QQuickText::FixedSize);
+ lineLaidOut->setText("");
+ QCOMPARE(lineLaidOut->lineCount(), 1);
}
void tst_qquicktext::lineHeight()
--
2.31.1

View File

@ -1,38 +0,0 @@
From 4d6078e4b556e83f55ffed55f14203c3ed880c62 Mon Sep 17 00:00:00 2001
From: Mitch Curtis <mitch.curtis@qt.io>
Date: Thu, 19 Nov 2020 16:39:23 +0100
Subject: [PATCH 09/28] Doc: mention that INCLUDEPATH must be set in some cases
Otherwise the generated type registrations .cpp file will not be able
to include the sources.
Change-Id: I7821c7674b4341546da2fc49e584bf10cc60b46f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 06c31f386f8664343debd219a522a8897df0f3ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
src/qml/doc/src/cppintegration/definetypes.qdoc | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/qml/doc/src/cppintegration/definetypes.qdoc b/src/qml/doc/src/cppintegration/definetypes.qdoc
index cbbbd9ba58..ece2fd5fd7 100644
--- a/src/qml/doc/src/cppintegration/definetypes.qdoc
+++ b/src/qml/doc/src/cppintegration/definetypes.qdoc
@@ -117,6 +117,14 @@ QML_IMPORT_NAME = com.mycompany.messaging
QML_IMPORT_MAJOR_VERSION = 1
\endcode
+If the header the class is declared in is not accessible from your project's
+include path, you may have to amend the include path so that the generated
+registration code can be compiled:
+
+\code
+INCLUDEPATH += com/mycompany/messaging
+\endcode
+
The type can be used in an \l{qtqml-syntax-basics.html#object-declarations}
{object declaration} from QML, and its properties can be read and written to,
as per the example below:
--
2.31.1

View File

@ -0,0 +1,565 @@
From 95f4632430db5668fa022983c76e4f6bde74c33d 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
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The accessibility tree for the Qt Quick content should
be rooted at the QQuickWidget, and not at the offscreen
QQuickWindow.
For this to be the case, several things must happen:
- QQuickWindow must not report the child interfaces
- QQuickWidget must report the child interfaces
- The child interfaces must report the QQuickWidget as the parent
Create accessibility interfaces for QQuickWidget and
and QQuickWigetOffscreenWindow (which now gets a proper
subclass), where the QQuickWidget interface reports
the child interfaces and the QQuickWigetOffscreenWindow
reports no children
Change the code in QAccessibleQuickItem to use the
true (visible) window, where needed.
Fixes: QTBUG-67290
Change-Id: I387d0ef711138d248a8dd16eefc9839499b35eeb
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 41926e08d73ea6c4bbfc87a1dd52d2cdbc435c27)
---
src/quick/accessible/qaccessiblequickitem.cpp | 29 +++--
src/quick/accessible/qaccessiblequickview_p.h | 2 +-
src/quickwidgets/qaccessiblequickwidget.cpp | 110 ++++++++++++++++++
src/quickwidgets/qaccessiblequickwidget.h | 84 +++++++++++++
.../qaccessiblequickwidgetfactory.cpp | 60 ++++++++++
.../qaccessiblequickwidgetfactory_p.h | 66 +++++++++++
src/quickwidgets/qquickwidget.cpp | 18 ++-
src/quickwidgets/qquickwidget_p.h | 8 ++
src/quickwidgets/quickwidgets.pro | 8 +-
9 files changed, 368 insertions(+), 17 deletions(-)
create mode 100644 src/quickwidgets/qaccessiblequickwidget.cpp
create mode 100644 src/quickwidgets/qaccessiblequickwidget.h
create mode 100644 src/quickwidgets/qaccessiblequickwidgetfactory.cpp
create mode 100644 src/quickwidgets/qaccessiblequickwidgetfactory_p.h
diff --git a/src/quick/accessible/qaccessiblequickitem.cpp b/src/quick/accessible/qaccessiblequickitem.cpp
index ae1954ae8d..0692ce634d 100644
--- a/src/quick/accessible/qaccessiblequickitem.cpp
+++ b/src/quick/accessible/qaccessiblequickitem.cpp
@@ -46,6 +46,7 @@
#include "QtQuick/private/qquicktextinput_p.h"
#include "QtQuick/private/qquickaccessibleattached_p.h"
#include "QtQuick/qquicktextdocument.h"
+#include "QtQuick/qquickrendercontrol.h"
QT_BEGIN_NAMESPACE
#if QT_CONFIG(accessibility)
@@ -57,7 +58,19 @@ QAccessibleQuickItem::QAccessibleQuickItem(QQuickItem *item)
QWindow *QAccessibleQuickItem::window() const
{
- return item()->window();
+ QQuickWindow *window = item()->window();
+
+ // For QQuickWidget the above window will be the offscreen QQuickWindow,
+ // which is not a part of the accessibility tree. Detect this case and
+ // return the window for the QQuickWidget instead.
+ if (window && !window->handle()) {
+ if (QQuickRenderControl *renderControl = QQuickWindowPrivate::get(window)->renderControl) {
+ if (QWindow *renderWindow = renderControl->renderWindow(nullptr))
+ return renderWindow;
+ }
+ }
+
+ return window;
}
int QAccessibleQuickItem::childCount() const
@@ -113,19 +126,15 @@ QAccessibleInterface *QAccessibleQuickItem::childAt(int x, int y) const
QAccessibleInterface *QAccessibleQuickItem::parent() const
{
QQuickItem *parent = item()->parentItem();
- QQuickWindow *window = item()->window();
- QQuickItem *ci = window ? window->contentItem() : nullptr;
+ QQuickWindow *itemWindow = item()->window();
+ QQuickItem *ci = itemWindow ? itemWindow->contentItem() : nullptr;
while (parent && !QQuickItemPrivate::get(parent)->isAccessible && parent != ci)
parent = parent->parentItem();
if (parent) {
if (parent == ci) {
- // Jump out to the scene widget if the parent is the root item.
- // There are two root items, QQuickWindow::rootItem and
- // QQuickView::declarativeRoot. The former is the true root item,
- // but is not a part of the accessibility tree. Check if we hit
- // it here and return an interface for the scene instead.
- return QAccessible::queryAccessibleInterface(window);
+ // Jump out to the window if the parent is the root item
+ return QAccessible::queryAccessibleInterface(window());
} else {
while (parent && !parent->d_func()->isAccessible)
parent = parent->parentItem();
@@ -193,7 +202,7 @@ QAccessible::State QAccessibleQuickItem::state() const
QRect viewRect_ = viewRect();
QRect itemRect = rect();
- if (viewRect_.isNull() || itemRect.isNull() || !item()->window() || !item()->window()->isVisible() ||!item()->isVisible() || qFuzzyIsNull(item()->opacity()))
+ if (viewRect_.isNull() || itemRect.isNull() || !window() || !window()->isVisible() ||!item()->isVisible() || qFuzzyIsNull(item()->opacity()))
state.invisible = true;
if (!viewRect_.intersects(itemRect))
state.offscreen = true;
diff --git a/src/quick/accessible/qaccessiblequickview_p.h b/src/quick/accessible/qaccessiblequickview_p.h
index 39ffcaf39c..8baa01330c 100644
--- a/src/quick/accessible/qaccessiblequickview_p.h
+++ b/src/quick/accessible/qaccessiblequickview_p.h
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
#if QT_CONFIG(accessibility)
-class QAccessibleQuickWindow : public QAccessibleObject
+class Q_QUICK_EXPORT QAccessibleQuickWindow : public QAccessibleObject
{
public:
QAccessibleQuickWindow(QQuickWindow *object);
diff --git a/src/quickwidgets/qaccessiblequickwidget.cpp b/src/quickwidgets/qaccessiblequickwidget.cpp
new file mode 100644
index 0000000000..6f04d6693f
--- /dev/null
+++ b/src/quickwidgets/qaccessiblequickwidget.cpp
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtQuick module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qaccessiblequickwidget.h"
+
+#include "qquickwidget_p.h"
+
+QT_BEGIN_NAMESPACE
+
+#if QT_CONFIG(accessibility)
+
+QAccessibleQuickWidget::QAccessibleQuickWidget(QQuickWidget* widget)
+: QAccessibleWidget(widget)
+, m_accessibleWindow(QQuickWidgetPrivate::get(widget)->offscreenWindow)
+{
+ // NOTE: m_accessibleWindow is a QAccessibleQuickWindow, and not a
+ // QAccessibleQuickWidgetOffscreenWindow (defined below). This means
+ // it will return the Quick item child interfaces, which is what's needed here
+ // (unlike QAccessibleQuickWidgetOffscreenWindow, which will report 0 children).
+}
+
+QAccessibleInterface *QAccessibleQuickWidget::child(int index) const
+{
+ return m_accessibleWindow.child(index);
+}
+
+int QAccessibleQuickWidget::childCount() const
+{
+ return m_accessibleWindow.childCount();
+}
+
+int QAccessibleQuickWidget::indexOfChild(const QAccessibleInterface *iface) const
+{
+ return m_accessibleWindow.indexOfChild(iface);
+}
+
+QAccessibleInterface *QAccessibleQuickWidget::childAt(int x, int y) const
+{
+ return m_accessibleWindow.childAt(x, y);
+}
+
+QAccessibleQuickWidgetOffscreenWindow::QAccessibleQuickWidgetOffscreenWindow(QQuickWindow *window)
+:QAccessibleQuickWindow(window)
+{
+
+}
+
+QAccessibleInterface *QAccessibleQuickWidgetOffscreenWindow::child(int index) const
+{
+ Q_UNUSED(index);
+ return nullptr;
+}
+
+int QAccessibleQuickWidgetOffscreenWindow::childCount() const
+{
+ return 0;
+}
+
+int QAccessibleQuickWidgetOffscreenWindow::indexOfChild(const QAccessibleInterface *iface) const
+{
+ Q_UNUSED(iface);
+ return -1;
+}
+
+QAccessibleInterface *QAccessibleQuickWidgetOffscreenWindow::QAccessibleQuickWidgetOffscreenWindow::childAt(int x, int y) const
+{
+ Q_UNUSED(x);
+ Q_UNUSED(y);
+ return nullptr;
+}
+
+#endif // accessibility
+
+QT_END_NAMESPACE
diff --git a/src/quickwidgets/qaccessiblequickwidget.h b/src/quickwidgets/qaccessiblequickwidget.h
new file mode 100644
index 0000000000..1f52c78c46
--- /dev/null
+++ b/src/quickwidgets/qaccessiblequickwidget.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtQuick module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QACCESSIBLEQUICKWIDGET_H
+#define QACCESSIBLEQUICKWIDGET_H
+
+#include "qquickwidget.h"
+#include <QtWidgets/qaccessiblewidget.h>
+
+#include <private/qaccessiblequickview_p.h>
+
+QT_BEGIN_NAMESPACE
+
+#if QT_CONFIG(accessibility)
+
+// These classes implement the QQuickWiget accessibility switcharoo,
+// where the child items of the QQuickWidgetOffscreenWindow are reported
+// as child accessible interfaces of the QAccessibleQuickWidget.
+class QAccessibleQuickWidget: public QAccessibleWidget
+{
+public:
+ QAccessibleQuickWidget(QQuickWidget* widget);
+
+ QAccessibleInterface *child(int index) const override;
+ int childCount() const override;
+ int indexOfChild(const QAccessibleInterface *iface) const override;
+ QAccessibleInterface *childAt(int x, int y) const override;
+
+private:
+ QAccessibleQuickWindow m_accessibleWindow;
+ Q_DISABLE_COPY(QAccessibleQuickWidget)
+};
+
+class QAccessibleQuickWidgetOffscreenWindow: public QAccessibleQuickWindow
+{
+public:
+ QAccessibleQuickWidgetOffscreenWindow(QQuickWindow *window);
+ QAccessibleInterface *child(int index) const override;
+ int childCount() const override;
+ int indexOfChild(const QAccessibleInterface *iface) const override;
+ QAccessibleInterface *childAt(int x, int y) const override;
+};
+
+#endif // accessibility
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/quickwidgets/qaccessiblequickwidgetfactory.cpp b/src/quickwidgets/qaccessiblequickwidgetfactory.cpp
new file mode 100644
index 0000000000..3756d0c27c
--- /dev/null
+++ b/src/quickwidgets/qaccessiblequickwidgetfactory.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtQuick module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qaccessiblequickwidgetfactory_p.h"
+#include "qaccessiblequickwidget.h"
+
+QT_BEGIN_NAMESPACE
+
+#if QT_CONFIG(accessibility)
+
+QAccessibleInterface *qAccessibleQuickWidgetFactory(const QString &classname, QObject *object)
+{
+ if (classname == QLatin1String("QQuickWidget")) {
+ return new QAccessibleQuickWidget(qobject_cast<QQuickWidget *>(object));
+ } else if (classname == QLatin1String("QQuickWidgetOffscreenWindow")) {
+ return new QAccessibleQuickWidgetOffscreenWindow(qobject_cast<QQuickWindow *>(object));
+ }
+ return 0;
+}
+
+#endif // accessibility
+
+QT_END_NAMESPACE
+
diff --git a/src/quickwidgets/qaccessiblequickwidgetfactory_p.h b/src/quickwidgets/qaccessiblequickwidgetfactory_p.h
new file mode 100644
index 0000000000..8c63b09f81
--- /dev/null
+++ b/src/quickwidgets/qaccessiblequickwidgetfactory_p.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtQuick module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/qaccessible.h>
+
+#ifndef QACCESSIBLEQUICKWIDGETFACTORY_H
+#define QACCESSIBLEQUICKWIDGETFACTORY_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+QT_BEGIN_NAMESPACE
+
+#if QT_CONFIG(accessibility)
+
+QAccessibleInterface *qAccessibleQuickWidgetFactory(const QString &classname, QObject *object);
+
+#endif
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 223d91f579..9c97b43518 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -39,6 +39,7 @@
#include "qquickwidget.h"
#include "qquickwidget_p.h"
+#include "qaccessiblequickwidgetfactory_p.h"
#include "private/qquickwindow_p.h"
#include "private/qquickitem_p.h"
@@ -75,9 +76,16 @@
QT_BEGIN_NAMESPACE
+QQuickWidgetOffscreenWindow::QQuickWidgetOffscreenWindow(QQuickWindowPrivate &dd, QQuickRenderControl *control)
+:QQuickWindow(dd, control)
+{
+ setTitle(QString::fromLatin1("Offscreen"));
+ setObjectName(QString::fromLatin1("QQuickOffScreenWindow"));
+}
+
// override setVisble to prevent accidental offscreen window being created
// by base class.
-class QQuickOffcreenWindowPrivate: public QQuickWindowPrivate {
+class QQuickWidgetOffscreenWindowPrivate: public QQuickWindowPrivate {
public:
void setVisible(bool visible) override {
Q_Q(QWindow);
@@ -105,10 +113,8 @@ void QQuickWidgetPrivate::init(QQmlEngine* e)
Q_Q(QQuickWidget);
renderControl = new QQuickWidgetRenderControl(q);
- offscreenWindow = new QQuickWindow(*new QQuickOffcreenWindowPrivate(),renderControl);
+ offscreenWindow = new QQuickWidgetOffscreenWindow(*new QQuickWidgetOffscreenWindowPrivate(), renderControl);
offscreenWindow->setScreen(q->screen());
- offscreenWindow->setTitle(QString::fromLatin1("Offscreen"));
- offscreenWindow->setObjectName(QString::fromLatin1("QQuickOffScreenWindow"));
// Do not call create() on offscreenWindow.
// Check if the Software Adaptation is being used
@@ -139,6 +145,10 @@ void QQuickWidgetPrivate::init(QQmlEngine* e)
QWidget::connect(offscreenWindow, &QQuickWindow::focusObjectChanged, q, &QQuickWidget::propagateFocusObjectChanged);
QObject::connect(renderControl, SIGNAL(renderRequested()), q, SLOT(triggerUpdate()));
QObject::connect(renderControl, SIGNAL(sceneChanged()), q, SLOT(triggerUpdate()));
+
+#if QT_CONFIG(accessibility)
+ QAccessible::installFactory(&qAccessibleQuickWidgetFactory);
+#endif
}
void QQuickWidgetPrivate::ensureEngine() const
diff --git a/src/quickwidgets/qquickwidget_p.h b/src/quickwidgets/qquickwidget_p.h
index 881f7f9220..1a946bcc71 100644
--- a/src/quickwidgets/qquickwidget_p.h
+++ b/src/quickwidgets/qquickwidget_p.h
@@ -148,6 +148,14 @@ public:
bool forceFullUpdate;
};
+class QQuickWidgetOffscreenWindow: public QQuickWindow
+{
+ Q_OBJECT
+
+public:
+ QQuickWidgetOffscreenWindow(QQuickWindowPrivate &dd, QQuickRenderControl *control);
+};
+
QT_END_NAMESPACE
#endif // QQuickWidget_P_H
diff --git a/src/quickwidgets/quickwidgets.pro b/src/quickwidgets/quickwidgets.pro
index 2438e577ae..f46deb54ac 100644
--- a/src/quickwidgets/quickwidgets.pro
+++ b/src/quickwidgets/quickwidgets.pro
@@ -7,9 +7,13 @@ DEFINES += QT_NO_URL_CAST_FROM_STRING QT_NO_INTEGER_EVENT_COORDINATES QT_NO_FO
HEADERS += \
qquickwidget.h \
qquickwidget_p.h \
- qtquickwidgetsglobal.h
+ qtquickwidgetsglobal.h \
+ qaccessiblequickwidget.h \
+ qaccessiblequickwidgetfactory_p.h
SOURCES += \
- qquickwidget.cpp
+ qquickwidget.cpp \
+ qaccessiblequickwidget.cpp \
+ qaccessiblequickwidgetfactory.cpp
load(qt_module)
--
2.40.1

View File

@ -0,0 +1,46 @@
From ffa3c975270c5026be40912451a289492956f01c 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
initialized
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Currently ObjectShow event is only sent when the visible property
changes from false to true, but for items with the notification
accessible role, a screen reader like Orca needs to receive an
ObjectShow event to read the notification, so also send the event after
a component is initialized.
See also: https://gitlab.gnome.org/GNOME/orca/-/merge_requests/134
Pick-to: 6.4
Change-Id: I626594b65ffe4d0582dcee9f489df0c2c63e53b7
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 9a4f2d23ecec2c7ff19f83cff28df6b97e3fda98)
---
src/quick/items/qquickitem.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index ec55fb2998..499fb61d1b 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -5125,6 +5125,13 @@ void QQuickItem::componentComplete()
d->addToDirtyList();
QQuickWindowPrivate::get(d->window)->dirtyItem(this);
}
+
+#if QT_CONFIG(accessibility)
+ if (d->isAccessible && d->effectiveVisible) {
+ QAccessibleEvent ev(this, QAccessible::ObjectShow);
+ QAccessible::updateAccessibility(&ev);
+ }
+#endif
}
QQuickStateGroup *QQuickItemPrivate::_states()
--
2.40.1

View File

@ -1,47 +0,0 @@
From 65851a450926befad65d9cffcaa217875d1936c6 Mon Sep 17 00:00:00 2001
From: Maximilian Goldstein <max.goldstein@qt.io>
Date: Mon, 23 Nov 2020 13:17:40 +0100
Subject: [PATCH 10/28] qmlfunctions.qdoc: Add clarification to QML_FOREIGN
Fixes: QTBUG-87150
Change-Id: If99a06a07892bdfef7b6b1e8fa737480750992fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 56f428c360191230b571969a2651e85380030afa)
---
examples/qml/doc/src/qml-extending.qdoc | 4 ++++
src/qml/doc/src/qmlfunctions.qdoc | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/examples/qml/doc/src/qml-extending.qdoc b/examples/qml/doc/src/qml-extending.qdoc
index 723e470d45..c9922ebd45 100644
--- a/examples/qml/doc/src/qml-extending.qdoc
+++ b/examples/qml/doc/src/qml-extending.qdoc
@@ -79,6 +79,10 @@ Qt's internal QLineEdit class.
\snippet referenceexamples/extended/lineedit.h 0
+Note the usage of \l QML_NAMED_ELEMENT() instead of \l QML_ELEMENT.
+QML_ELEMENT uses the name of the containing type by default, "LineEditExtension" in this case.
+As the class being an extension class is an implementation detail, we choose the more natural name "LineEdit" instead
+
The QML engine then instantiates a \l QLineEdit:
\snippet referenceexamples/extended/main.cpp 1
diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc
index 12b7efb159..4e531ceb61 100644
--- a/src/qml/doc/src/qmlfunctions.qdoc
+++ b/src/qml/doc/src/qmlfunctions.qdoc
@@ -250,6 +250,10 @@
This is useful for registering types that cannot be amended to add the macros,
for example because they belong to 3rdparty libraries.
+ \b{NOTE:} You may want to use \l QML_NAMED_ELEMENT() instead of \l QML_ELEMENT due to the fact that
+ the element will be named like the struct it is contained in, not the foreign type.
+ See \l {Extending QML - Extension Objects Example} for an example.
+
\sa QML_ELEMENT, QML_NAMED_ELEMENT()
*/
--
2.31.1

View File

@ -1,214 +0,0 @@
From b2862e2bd84d651c1f4fb2ced96ee6f40ea1f3e4 Mon Sep 17 00:00:00 2001
From: Andrei Golubev <andrei.golubev@qt.io>
Date: Fri, 20 Nov 2020 10:44:44 +0100
Subject: [PATCH 11/28] Fix QML property cache leaks of delegate items
The delegate items are destroyed through an event loop by a call to a
deleteLater(). This, however, doesn't work when the application is
in the process of exiting and the event loop is already closed (i.e.
we're in a stack unwinding part that starts after app.exec())
Combat this situation by setting a parent of the to-be-deleted object
to some QObject that will be destroyed e.g. QCoreApplication::instance()
before the program finishes. As QObjects clean their children on
destruction, this will make sure that we cleanup the previously leaking
thing regardless of the event loop
Added a test to check that delegates are destroyed (as a separate binary
due to differences in main() function)
Fixes: QTBUG-87228
Change-Id: I59066603b77497fe4fd8d051798c3e4b47c119f0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 3a5617dc45e281552b9c1f7a04f0561b8fa14d94)
---
src/qmlmodels/qqmldelegatemodel.cpp | 11 ++-
.../qquickview_extra/data/qtbug_87228.qml | 30 ++++++++
.../qquickview_extra/qquickview_extra.pro | 12 +++
.../qquickview_extra/tst_qquickview_extra.cpp | 77 +++++++++++++++++++
tests/auto/quick/quick.pro | 1 +
5 files changed, 130 insertions(+), 1 deletion(-)
create mode 100644 tests/auto/quick/qquickview_extra/data/qtbug_87228.qml
create mode 100644 tests/auto/quick/qquickview_extra/qquickview_extra.pro
create mode 100644 tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp
diff --git a/src/qmlmodels/qqmldelegatemodel.cpp b/src/qmlmodels/qqmldelegatemodel.cpp
index 725b9e8bc3..12c3d11937 100644
--- a/src/qmlmodels/qqmldelegatemodel.cpp
+++ b/src/qmlmodels/qqmldelegatemodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtQml module of the Qt Toolkit.
@@ -2379,6 +2379,15 @@ void QQmlDelegateModelItem::destroyObject()
data->ownContext = nullptr;
data->context = nullptr;
}
+ /* QTBUG-87228: when destroying object at the application exit, the deferred
+ * parent by setting it to QCoreApplication instance if it's nullptr, so
+ * deletion won't work. Not to leak memory, make sure our object has a that
+ * the parent claims the object at the end of the lifetime. When not at the
+ * application exit, normal event loop will handle the deferred deletion
+ * earlier.
+ */
+ if (object->parent() == nullptr)
+ object->setParent(QCoreApplication::instance());
object->deleteLater();
if (attached) {
diff --git a/tests/auto/quick/qquickview_extra/data/qtbug_87228.qml b/tests/auto/quick/qquickview_extra/data/qtbug_87228.qml
new file mode 100644
index 0000000000..ff10eba23d
--- /dev/null
+++ b/tests/auto/quick/qquickview_extra/data/qtbug_87228.qml
@@ -0,0 +1,30 @@
+import QtQml 2.12
+import QtQml.Models 2.12
+import QtQuick 2.12
+
+Item {
+ height: 480
+ width: 320
+ Rectangle {
+ id: rootRect
+
+ function addItem(desc) {
+ myModel.append({"desc": desc});
+ }
+
+ Rectangle {
+ ListView {
+ objectName: "listView"
+ delegate: Text {
+ required property string desc
+ text: desc
+ }
+ model: ListModel { id: myModel }
+ }
+ }
+
+ Component.onCompleted: {
+ addItem("Test creation of a delegate with a property");
+ }
+ }
+}
diff --git a/tests/auto/quick/qquickview_extra/qquickview_extra.pro b/tests/auto/quick/qquickview_extra/qquickview_extra.pro
new file mode 100644
index 0000000000..b40af0ce19
--- /dev/null
+++ b/tests/auto/quick/qquickview_extra/qquickview_extra.pro
@@ -0,0 +1,12 @@
+CONFIG += testcase
+TARGET = tst_qquickview_extra
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qquickview_extra.cpp
+
+include (../../shared/util.pri)
+include (../shared/util.pri)
+
+TESTDATA = data/*
+
+QT += core-private gui-private qml-private quick-private testlib
diff --git a/tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp b/tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp
new file mode 100644
index 0000000000..f697a438bd
--- /dev/null
+++ b/tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtTest/QSignalSpy>
+#include <QtQuick/qquickview.h>
+#include <QtQuick/qquickitem.h>
+#include <QtQml/qqmlengine.h>
+#include "../../shared/util.h"
+#include <QtCore/QDebug>
+#include <QtCore/QTimer>
+
+// Extra app-less tests
+class tst_QQuickViewExtra : public QQmlDataTest
+{
+ Q_OBJECT
+public:
+ tst_QQuickViewExtra();
+
+private slots:
+ void qtbug_87228();
+};
+
+tst_QQuickViewExtra::tst_QQuickViewExtra() { }
+
+void tst_QQuickViewExtra::qtbug_87228()
+{
+ QScopedPointer<QSignalSpy> deletionSpy;
+ {
+ int argc = 0;
+ QGuiApplication app(argc, nullptr);
+ QQuickView view;
+
+ view.setSource(testFileUrl("qtbug_87228.qml"));
+ view.show();
+ QTimer::singleShot(500, &app, QCoreApplication::quit);
+ app.exec();
+
+ QObject *listView = view.findChild<QObject *>("listView");
+ QVERIFY(listView);
+ QQuickItem *contentItem = listView->property("contentItem").value<QQuickItem *>();
+ QVERIFY(contentItem);
+ auto children = contentItem->childItems();
+ QVERIFY(children.size() > 0);
+ // for the sake of this test, any child would be suitable, so pick first
+ deletionSpy.reset(new QSignalSpy(children[0], SIGNAL(destroyed(QObject *))));
+ }
+ QCOMPARE(deletionSpy->count(), 1);
+}
+
+QTEST_APPLESS_MAIN(tst_QQuickViewExtra)
+
+#include "tst_qquickview_extra.moc"
diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro
index 541bfdd527..45bcf8a9ce 100644
--- a/tests/auto/quick/quick.pro
+++ b/tests/auto/quick/quick.pro
@@ -85,6 +85,7 @@ QUICKTESTS += \
qquicktextinput \
qquickvisualdatamodel \
qquickview \
+ qquickview_extra \
qquickcanvasitem \
qquickdesignersupport \
qquickscreen \
--
2.31.1

View File

@ -0,0 +1,113 @@
From 2384b04415045b2203894b24a3743b03eeadbc88 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
If a QQuickItem is in the QQuickItem destructor, then it is both unsafe
and unnecessary to emit property change notifications. Connected code
can no longer rely on the state of the emitting object - if it was
originally a subclass of QQuickItem, then those subclass destructors
will already have run. And the QQuickItem destructor will also have
partially run, leaving the object in an undefined state.
Add a flag that we set to true at the top of ~QQuickItem, and don't emit
visibleChildrenChanged, parentChanged, visibleChanged, and
childrenChanged for items that are partially destroyed already.
[ChangeLog][Qt Quick][QQuickItem] QQuickItem no longer emits change
notifications for the parent, children, visible, and visibleChildren
properties while it is being destroyed.
Task-number: QTBUG-107850
Change-Id: I36ea98842c89ad89fcc1c4a328d138f66f2a0446
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 74873324bdf3399753f9fcaf7461c0e00df628b1)
---
src/quick/items/qquickitem.cpp | 21 +++++++++++++--------
src/quick/items/qquickitem_p.h | 1 +
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 499fb61d1b..5ee2a440a3 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -2327,6 +2327,7 @@ QQuickItem::QQuickItem(QQuickItemPrivate &dd, QQuickItem *parent)
QQuickItem::~QQuickItem()
{
Q_D(QQuickItem);
+ d->inDestructor = true;
if (d->windowRefCount > 1)
d->windowRefCount = 1; // Make sure window is set to null in next call to derefWindow().
@@ -2694,9 +2695,8 @@ void QQuickItem::setParentItem(QQuickItem *parentItem)
const bool wasVisible = isVisible();
op->removeChild(this);
- if (wasVisible) {
+ if (wasVisible && !op->inDestructor)
emit oldParentItem->visibleChildrenChanged();
- }
} else if (d->window) {
QQuickWindowPrivate::get(d->window)->parentlessItems.remove(this);
}
@@ -2773,8 +2773,9 @@ void QQuickItem::setParentItem(QQuickItem *parentItem)
d->itemChange(ItemParentHasChanged, d->parentItem);
- emit parentChanged(d->parentItem);
- if (isVisible() && d->parentItem)
+ if (!d->inDestructor)
+ emit parentChanged(d->parentItem);
+ if (isVisible() && d->parentItem && !QQuickItemPrivate::get(d->parentItem)->inDestructor)
emit d->parentItem->visibleChildrenChanged();
}
@@ -2970,7 +2971,8 @@ void QQuickItemPrivate::removeChild(QQuickItem *child)
itemChange(QQuickItem::ItemChildRemovedChange, child);
- emit q->childrenChanged();
+ if (!inDestructor)
+ emit q->childrenChanged();
}
void QQuickItemPrivate::refWindow(QQuickWindow *c)
@@ -3199,6 +3201,7 @@ QQuickItemPrivate::QQuickItemPrivate()
, touchEnabled(false)
#endif
, hasCursorHandler(false)
+ , inDestructor(false)
, dirtyAttributes(0)
, nextDirtyItem(nullptr)
, prevDirtyItem(nullptr)
@@ -6118,9 +6121,11 @@ bool QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible)
QAccessible::updateAccessibility(&ev);
}
#endif
- emit q->visibleChanged();
- if (childVisibilityChanged)
- emit q->visibleChildrenChanged();
+ if (!inDestructor) {
+ emit q->visibleChanged();
+ if (childVisibilityChanged)
+ emit q->visibleChildrenChanged();
+ }
return true; // effective visibility DID change
}
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h
index 841d91bb40..ade8fb61f2 100644
--- a/src/quick/items/qquickitem_p.h
+++ b/src/quick/items/qquickitem_p.h
@@ -472,6 +472,7 @@ public:
bool replayingPressEvent:1;
bool touchEnabled:1;
bool hasCursorHandler:1;
+ quint32 inDestructor:1; // has entered ~QQuickItem
enum DirtyType {
TransformOrigin = 0x00000001,
--
2.40.1

View File

@ -1,66 +0,0 @@
From 89ea9f1f9468aa47718cbb398317c63a9479adf2 Mon Sep 17 00:00:00 2001
From: Fabian Kosmale <fabian.kosmale@qt.io>
Date: Tue, 24 Nov 2020 13:23:23 +0100
Subject: [PATCH 12/28] QQuickTextInput: Store mask data in std::unique_ptr
This ensures that the memory is freed reliably
Fixes: QTBUG-88807
Change-Id: I841a5a2b226a69ce50975d95702a948857d1b54f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit d2d8e90e9f218103d60737e1273ab5322834d9ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
src/quick/items/qquicktextinput.cpp | 6 ++----
src/quick/items/qquicktextinput_p_p.h | 4 +++-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 6275b298ed..bb78ead0e8 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -3831,8 +3831,7 @@ void QQuickTextInputPrivate::parseInputMask(const QString &maskFields)
int delimiter = maskFields.indexOf(QLatin1Char(';'));
if (maskFields.isEmpty() || delimiter == 0) {
if (m_maskData) {
- delete [] m_maskData;
- m_maskData = nullptr;
+ m_maskData.reset(nullptr);
m_maxLength = 32767;
internalSetText(QString());
}
@@ -3863,8 +3862,7 @@ void QQuickTextInputPrivate::parseInputMask(const QString &maskFields)
m_maxLength++;
}
- delete [] m_maskData;
- m_maskData = new MaskInputData[m_maxLength];
+ m_maskData.reset(new MaskInputData[m_maxLength]);
MaskInputData::Casemode m = MaskInputData::NoCaseMode;
c = 0;
diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h
index 7965f3d3f4..7fbba49405 100644
--- a/src/quick/items/qquicktextinput_p_p.h
+++ b/src/quick/items/qquicktextinput_p_p.h
@@ -58,6 +58,8 @@
#include "qplatformdefs.h"
+#include <memory>
+
//
// W A R N I N G
// -------------
@@ -230,7 +232,7 @@ public:
QQuickItem *cursorItem;
QQuickTextNode *textNode;
- MaskInputData *m_maskData;
+ std::unique_ptr<MaskInputData[]> m_maskData;
QInputControl *m_inputControl;
QList<int> m_transactions;
--
2.31.1

View File

@ -0,0 +1,57 @@
From 5b6faa5cc115d5be8b2300e059592f8dd1a84ac8 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
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
disabled items are neither enabled nor focusable
Change-Id: I4f286c7b85605d5ad6fa787d1f5cfcce1297d268
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 20fd2902a6d7bdb4a3306005d2718ca5a8fef96d)
---
src/quick/accessible/qaccessiblequickitem.cpp | 4 ++++
src/quick/items/qquickitem.cpp | 9 +++++++++
2 files changed, 13 insertions(+)
diff --git a/src/quick/accessible/qaccessiblequickitem.cpp b/src/quick/accessible/qaccessiblequickitem.cpp
index 0692ce634d..a8df58d450 100644
--- a/src/quick/accessible/qaccessiblequickitem.cpp
+++ b/src/quick/accessible/qaccessiblequickitem.cpp
@@ -215,6 +215,10 @@ QAccessible::State QAccessibleQuickItem::state() const
if (role() == QAccessible::EditableText)
if (auto ti = qobject_cast<QQuickTextInput *>(item()))
state.passwordEdit = ti->echoMode() != QQuickTextInput::Normal;
+ if (!item()->isEnabled()) {
+ state.focusable = false;
+ state.disabled = true;
+ }
return state;
}
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 5ee2a440a3..c370d6e5c3 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -6174,6 +6174,15 @@ void QQuickItemPrivate::setEffectiveEnableRecur(QQuickItem *scope, bool newEffec
}
itemChange(QQuickItem::ItemEnabledHasChanged, effectiveEnable);
+#if QT_CONFIG(accessibility)
+ if (isAccessible) {
+ QAccessible::State changedState;
+ changedState.disabled = true;
+ changedState.focusable = true;
+ QAccessibleStateChangeEvent ev(q, changedState);
+ QAccessible::updateAccessibility(&ev);
+ }
+#endif
emit q->enabledChanged();
}
--
2.40.1

View File

@ -1,100 +0,0 @@
From 810a0afe1e9bd14e4393a73bf6c299b25745dbc5 Mon Sep 17 00:00:00 2001
From: Richard Weickelt <richard@weickelt.de>
Date: Tue, 24 Nov 2020 01:14:28 +0100
Subject: [PATCH 13/28] Fix crash when calling hasOwnProperty() on proxy object
Property pointer p needs to be checked for nullptr value in
QV4::ProxyObject::virtualGetOwnProperty(). This can happen when calling
hasOwnProperty() or propertyIsEnumerable().
Fixes: QTBUG-88786
Change-Id: I43da58fed4d8656f9187213f7317f17398739e34
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 9b321a34490cd17c0eb043b69bd7c9d8d8f513d5)
Reviewed-by: Richard Weickelt <richard@weickelt.de>
---
src/qml/jsruntime/qv4proxy.cpp | 10 +++---
.../qml/qqmlecmascript/tst_qqmlecmascript.cpp | 31 ++++++++++++++++++-
2 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/src/qml/jsruntime/qv4proxy.cpp b/src/qml/jsruntime/qv4proxy.cpp
index 24676ffd00..1505eae426 100644
--- a/src/qml/jsruntime/qv4proxy.cpp
+++ b/src/qml/jsruntime/qv4proxy.cpp
@@ -265,9 +265,9 @@ PropertyAttributes ProxyObject::virtualGetOwnProperty(const Managed *m, Property
ScopedProperty targetDesc(scope);
PropertyAttributes targetAttributes = target->getOwnProperty(id, targetDesc);
if (trapResult->isUndefined()) {
- p->value = Encode::undefined();
- if (targetAttributes == Attr_Invalid) {
+ if (p)
p->value = Encode::undefined();
+ if (targetAttributes == Attr_Invalid) {
return Attr_Invalid;
}
if (!targetAttributes.isConfigurable() || !target->isExtensible()) {
@@ -295,8 +295,10 @@ PropertyAttributes ProxyObject::virtualGetOwnProperty(const Managed *m, Property
}
}
- p->value = resultDesc->value;
- p->set = resultDesc->set;
+ if (p) {
+ p->value = resultDesc->value;
+ p->set = resultDesc->set;
+ }
return resultAttributes;
}
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 1e10841430..3a9d1bfb4c 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -382,7 +382,7 @@ private slots:
void semicolonAfterProperty();
void hugeStack();
void variantConversionMethod();
-
+ void proxyHandlerTraps();
void gcCrashRegressionTest();
private:
@@ -9306,6 +9306,35 @@ void tst_qqmlecmascript::variantConversionMethod()
QCOMPARE(obj.funcCalled, QLatin1String("QModelIndex"));
}
+void tst_qqmlecmascript::proxyHandlerTraps()
+{
+ const QString expression = QStringLiteral(R"SNIPPET(
+ (function(){
+ const target = {
+ prop: 47
+ };
+ const handler = {
+ getOwnPropertyDescriptor(target, prop) {
+ return { configurable: true, enumerable: true, value: 47 };
+ }
+ };
+ const proxy = new Proxy(target, handler);
+
+ // QTBUG-88786
+ if (!proxy.propertyIsEnumerable("prop"))
+ throw Error("FAIL: propertyisEnumerable");
+ if (!proxy.hasOwnProperty("prop"))
+ throw Error("FAIL: hasOwnProperty");
+
+ return "SUCCESS";
+ })()
+ )SNIPPET");
+
+ QJSEngine engine;
+ QJSValue value = engine.evaluate(expression);
+ QVERIFY(value.isString() && value.toString() == QStringLiteral("SUCCESS"));
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"
--
2.31.1

View File

@ -0,0 +1,87 @@
From 3d4ff545a998066f563d03bd0e0da6aee81e811d 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
Its base class is private API, so it should be private API, too.
Change-Id: Ic80f841fee19ed0305c60ad5f8e9349a05f09e5e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit a4fa74d3e7581cb5c6bb82223ee17257f66fa41d)
---
src/quickwidgets/qaccessiblequickwidget.cpp | 2 +-
...ssiblequickwidget.h => qaccessiblequickwidget_p.h} | 11 +++++++++++
src/quickwidgets/qaccessiblequickwidgetfactory.cpp | 2 +-
src/quickwidgets/quickwidgets.pro | 2 +-
4 files changed, 14 insertions(+), 3 deletions(-)
rename src/quickwidgets/{qaccessiblequickwidget.h => qaccessiblequickwidget_p.h} (92%)
diff --git a/src/quickwidgets/qaccessiblequickwidget.cpp b/src/quickwidgets/qaccessiblequickwidget.cpp
index 6f04d6693f..8a1c901880 100644
--- a/src/quickwidgets/qaccessiblequickwidget.cpp
+++ b/src/quickwidgets/qaccessiblequickwidget.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qaccessiblequickwidget.h"
+#include "qaccessiblequickwidget_p.h"
#include "qquickwidget_p.h"
diff --git a/src/quickwidgets/qaccessiblequickwidget.h b/src/quickwidgets/qaccessiblequickwidget_p.h
similarity index 92%
rename from src/quickwidgets/qaccessiblequickwidget.h
rename to src/quickwidgets/qaccessiblequickwidget_p.h
index 1f52c78c46..7c2ab930e0 100644
--- a/src/quickwidgets/qaccessiblequickwidget.h
+++ b/src/quickwidgets/qaccessiblequickwidget_p.h
@@ -40,6 +40,17 @@
#ifndef QACCESSIBLEQUICKWIDGET_H
#define QACCESSIBLEQUICKWIDGET_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qquickwidget.h"
#include <QtWidgets/qaccessiblewidget.h>
diff --git a/src/quickwidgets/qaccessiblequickwidgetfactory.cpp b/src/quickwidgets/qaccessiblequickwidgetfactory.cpp
index 3756d0c27c..7ba88a1769 100644
--- a/src/quickwidgets/qaccessiblequickwidgetfactory.cpp
+++ b/src/quickwidgets/qaccessiblequickwidgetfactory.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qaccessiblequickwidgetfactory_p.h"
-#include "qaccessiblequickwidget.h"
+#include "qaccessiblequickwidget_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/quickwidgets/quickwidgets.pro b/src/quickwidgets/quickwidgets.pro
index f46deb54ac..85d156b8a3 100644
--- a/src/quickwidgets/quickwidgets.pro
+++ b/src/quickwidgets/quickwidgets.pro
@@ -8,7 +8,7 @@ HEADERS += \
qquickwidget.h \
qquickwidget_p.h \
qtquickwidgetsglobal.h \
- qaccessiblequickwidget.h \
+ qaccessiblequickwidget_p.h \
qaccessiblequickwidgetfactory_p.h
SOURCES += \
--
2.40.1

View File

@ -1,44 +0,0 @@
From 514a69659a56fda410f4ab955f03c0d2a38b52f9 Mon Sep 17 00:00:00 2001
From: Piotr Mikolajczyk <piotr.mikolajczyk@qt.io>
Date: Tue, 10 Nov 2020 14:58:12 +0100
Subject: [PATCH 14/28] Accessibility event is sent on item's geometry change
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In case of enabled accessibility, whenever the geometry
of a QQuickItem changes, accessibility module is notified
by a LocationChange event. This enables responding to this
by for example moving the accessibility frame on the screen.
Task-number: QTBUG-79611
Change-Id: I808e835384ef42bba2e9aabecf4be3cda07859fe
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit def81070668f101e1e2cbb46d586bbab64c8e00f)
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
---
src/quick/items/qquickitem.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 67c4611d9e..ddd67522b9 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -3753,6 +3753,14 @@ void QQuickItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeo
emit widthChanged();
if (change.heightChange())
emit heightChanged();
+#if QT_CONFIG(accessibility)
+ if (QAccessible::isActive()) {
+ if (QObject *acc = QQuickAccessibleAttached::findAccessible(this)) {
+ QAccessibleEvent ev(acc, QAccessible::LocationChanged);
+ QAccessible::updateAccessibility(&ev);
+ }
+ }
+#endif
}
/*!
--
2.31.1

View File

@ -0,0 +1,113 @@
From 0d21fc0cb74c01368107bf2779c34e5734b5e5ae 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
Such types don't have a compilation unit, but we still know their names.
Pick-to: 6.2
Fixes: QTBUG-98792
Change-Id: I2db8dea3a5a02ec1492f7f7a054fd3ad4c6ad69a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit e0cd201e91ae64b9c03e0128cd17656b00611fbb)
---
src/qml/qml/qqmltypewrapper.cpp | 6 ++++--
src/qml/types/qqmlconnections.cpp | 2 +-
tests/auto/qml/qqmllanguage/data/Broken.qml | 5 +++++
tests/auto/qml/qqmllanguage/data/asBroken.qml | 6 ++++++
tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 16 ++++++++++++++++
5 files changed, 32 insertions(+), 3 deletions(-)
create mode 100644 tests/auto/qml/qqmllanguage/data/Broken.qml
create mode 100644 tests/auto/qml/qqmllanguage/data/asBroken.qml
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp
index 175de8b936..a6ba4b8cb3 100644
--- a/src/qml/qml/qqmltypewrapper.cpp
+++ b/src/qml/qml/qqmltypewrapper.cpp
@@ -419,8 +419,10 @@ ReturnedValue QQmlTypeWrapper::virtualInstanceOf(const Object *typeObject, const
return Encode(false);
QQmlRefPointer<QQmlTypeData> td = qenginepriv->typeLoader.getType(typeWrapper->d()->type().sourceUrl());
- ExecutableCompilationUnit *cu = td->compilationUnit();
- myQmlType = qenginepriv->metaObjectForType(cu->metaTypeId);
+ if (ExecutableCompilationUnit *cu = td->compilationUnit())
+ myQmlType = qenginepriv->metaObjectForType(cu->metaTypeId);
+ else
+ return Encode(false); // It seems myQmlType has some errors, so we could not compile it.
} else {
myQmlType = qenginepriv->metaObjectForType(myTypeId);
}
diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp
index 29ed62cd39..aba930dfe1 100644
--- a/src/qml/types/qqmlconnections.cpp
+++ b/src/qml/types/qqmlconnections.cpp
@@ -338,7 +338,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 "
- "signal of the target matches the name.").arg(propName);
+ "signal of the \"%2\" target matches the name.").arg(propName).arg(target->metaObject()->className());
}
}
}
diff --git a/tests/auto/qml/qqmllanguage/data/Broken.qml b/tests/auto/qml/qqmllanguage/data/Broken.qml
new file mode 100644
index 0000000000..e24d9112a8
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/Broken.qml
@@ -0,0 +1,5 @@
+import QtQml 2.15
+
+QtObject {
+ notThere: 5
+}
diff --git a/tests/auto/qml/qqmllanguage/data/asBroken.qml b/tests/auto/qml/qqmllanguage/data/asBroken.qml
new file mode 100644
index 0000000000..bd88d14c76
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/asBroken.qml
@@ -0,0 +1,6 @@
+import QtQml 2.15
+
+QtObject {
+ id: self
+ 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
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -336,6 +336,7 @@ private slots:
void bareInlineComponent();
void hangOnWarning();
+ void objectAsBroken();
void ambiguousContainingType();
@@ -5876,6 +5877,21 @@ void tst_qqmllanguage::ambiguousContainingType()
}
}
+void tst_qqmllanguage::objectAsBroken()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("asBroken.qml"));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(!o.isNull());
+ QVariant selfAsBroken = o->property("selfAsBroken");
+ QVERIFY(selfAsBroken.isValid());
+ // QCOMPARE(selfAsBroken.metaType(), QMetaType::fromType<std::nullptr_t>());
+
+ QQmlComponent b(&engine, testFileUrl("Broken.qml"));
+ QVERIFY(b.isError());
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"
--
2.40.1

View File

@ -0,0 +1,54 @@
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,36 +0,0 @@
From 3c075bfd348306cd553caddb9f8bf3f596666636 Mon Sep 17 00:00:00 2001
From: Alessandro Portale <alessandro.portale@qt.io>
Date: Wed, 25 Nov 2020 23:43:03 +0100
Subject: [PATCH 15/28] qmltypes.prf: Take abi into account for
*_metatypes.json file names
The lib/metatypes/*_metatypes.json file names contain the ABI. When
constructing the qmltyperegistrar command, the right file names
with that ABI part need to be passed as "foreign-types".
Fixes: QTBUG-85888
Fixes: QTBUG-87117
Change-Id: I20daac1b6b9a27c5ac48b3c2c685e2fed301e213
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit acc5e48a90d0daeccb28175b80ab6b52cac5d84a)
---
src/qmltyperegistrar/qmltypes.prf | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qmltyperegistrar/qmltypes.prf b/src/qmltyperegistrar/qmltypes.prf
index 354fa1736f..2cc0027b7e 100644
--- a/src/qmltyperegistrar/qmltypes.prf
+++ b/src/qmltyperegistrar/qmltypes.prf
@@ -44,7 +44,8 @@ qt_module_deps = $$replace(qt_module_deps, _private$, '')
qt_module_deps = $$unique(qt_module_deps)
for(dep, qt_module_deps) {
- METATYPES_FILENAME = $$lower($$eval(QT.$${dep}.module))_metatypes.json
+ android:ABI = _$${ANDROID_TARGET_ARCH}
+ METATYPES_FILENAME = $$lower($$eval(QT.$${dep}.module))$${ABI}_metatypes.json
INSTALLED_METATYPES = $$[QT_INSTALL_LIBS]/metatypes/$$METATYPES_FILENAME
isEmpty(MODULE_BASE_OUTDIR) {
QML_FOREIGN_METATYPES += $$INSTALLED_METATYPES
--
2.31.1

View File

@ -0,0 +1,32 @@
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,68 +0,0 @@
From 37c290c5b8659256ff574a06a3df2c363ae446b5 Mon Sep 17 00:00:00 2001
From: Maximilian Goldstein <max.goldstein@qt.io>
Date: Wed, 2 Dec 2020 13:08:57 +0100
Subject: [PATCH 16/28] qv4qmlcontext: Fix bounded signal expressions when
debugging
Fixes: QTBUG-83599
Change-Id: I8909f0b2d3eca909512b99c172c8dc5e93e48482
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit bad85119bf35468292cfd80ecc934b66515f0c68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
src/qml/jsruntime/qv4qmlcontext.cpp | 4 ++--
.../qml/debugger/qv4debugger/tst_qv4debugger.cpp | 12 +++++++++---
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp
index e2d3b98ff6..6eece147a6 100644
--- a/src/qml/jsruntime/qv4qmlcontext.cpp
+++ b/src/qml/jsruntime/qv4qmlcontext.cpp
@@ -466,9 +466,9 @@ ReturnedValue QQmlContextWrapper::resolveQmlContextPropertyLookupGetter(Lookup *
return static_cast<Heap::CallContext *>(ctx)->locals[index].asReturnedValue();
}
- // Skip only block contexts within the current call context.
+ // Skip only block and call contexts.
// Other contexts need a regular QML property lookup. See below.
- if (ctx->type != Heap::ExecutionContext::Type_BlockContext)
+ if (ctx->type != Heap::ExecutionContext::Type_BlockContext && ctx->type != Heap::ExecutionContext::Type_CallContext)
break;
}
diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
index 84f5eebd10..e3cbeb9891 100644
--- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
@@ -910,19 +910,25 @@ void tst_qv4debugger::signalParameters()
component.setData("import QtQml 2.12\n"
"QtObject {\n"
" id: root\n"
- " property string result\n"
+ " property string result: 'unset'\n"
+ " property string resultCallbackInternal: 'unset'\n"
+ " property string resultCallbackExternal: 'unset'\n"
" signal signalWithArg(string textArg)\n"
+ " function call(callback) { callback(); }\n"
+ " function externalCallback() { root.resultCallbackExternal = textArg; }\n"
" property Connections connections : Connections {\n"
" target: root\n"
- " onSignalWithArg: { root.result = textArg; }\n"
+ " onSignalWithArg: { root.result = textArg; call(function() { root.resultCallbackInternal = textArg; }); call(externalCallback); }\n"
" }\n"
" Component.onCompleted: signalWithArg('something')\n"
"}", QUrl("test.qml"));
- QVERIFY(component.isReady());
+ QVERIFY2(component.isReady(), qPrintable(component.errorString()));
QScopedPointer<QObject> obj(component.create());
QVERIFY(obj);
QCOMPARE(obj->property("result").toString(), QLatin1String("something"));
+ QCOMPARE(obj->property("resultCallbackInternal").toString(), QLatin1String("something"));
+ QCOMPARE(obj->property("resultCallbackExternal").toString(), QLatin1String("unset"));
}
QTEST_MAIN(tst_qv4debugger)
--
2.31.1

View File

@ -0,0 +1,57 @@
From 0d217b88c6bf5673464e350e3a62773e69555f98 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
path be first
If it already exists in the import list, move it to the first place.
This is as per the description of QQmlEngine::addImportPath:
| The newly added path will be first in the importPathList().
Change-Id: I782d355c46ada2a46cff72e63326208f39028e01
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 3e413803c698d21f398daf0450c8f501204eb167)
---
src/qml/qml/qqmlimport.cpp | 9 ++++++---
tests/auto/qml/qqmlimport/tst_qqmlimport.cpp | 5 +++++
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
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -2120,9 +2120,12 @@ void QQmlImportDatabase::addImportPath(const QString& path)
cPath.replace(Backslash, Slash);
}
- if (!cPath.isEmpty()
- && !fileImportPath.contains(cPath))
- fileImportPath.prepend(cPath);
+ if (!cPath.isEmpty()) {
+ if (fileImportPath.contains(cPath))
+ fileImportPath.move(fileImportPath.indexOf(cPath), 0);
+ else
+ fileImportPath.prepend(cPath);
+ }
}
/*!
diff --git a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp
index 9c865b3f73..1f788f7a7f 100644
--- a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp
+++ b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp
@@ -154,6 +154,11 @@ void tst_QQmlImport::importPathOrder()
engine.addImportPath(QT_QMLTEST_DATADIR);
expectedImportPaths.prepend(QT_QMLTEST_DATADIR);
QCOMPARE(expectedImportPaths, engine.importPathList());
+
+ // Add qml2Imports again to make it the first of the list
+ engine.addImportPath(qml2Imports);
+ expectedImportPaths.move(expectedImportPaths.indexOf(qml2Imports), 0);
+ QCOMPARE(expectedImportPaths, engine.importPathList());
}
Q_DECLARE_METATYPE(QQmlImports::ImportVersion)
--
2.40.1

View File

@ -1,32 +0,0 @@
From 30c7a6c6a874264800d398df8c3ec65f30707c92 Mon Sep 17 00:00:00 2001
From: Li Xinwei <1326710505@qq.com>
Date: Tue, 8 Dec 2020 15:36:01 +0800
Subject: [PATCH 17/28] Use load(qt_tool) for qmltime
The qmltime should be a tool, not a normal executable or an app.
Change-Id: I64c76877907297a6a817ba5903786bcc7fba8fdd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e6e262da1423bcb7cfe3db9f83fe0df54483c8d4)
---
tools/qmltime/qmltime.pro | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/qmltime/qmltime.pro b/tools/qmltime/qmltime.pro
index c915f6e8c1..366d90f75b 100644
--- a/tools/qmltime/qmltime.pro
+++ b/tools/qmltime/qmltime.pro
@@ -1,4 +1,3 @@
-TEMPLATE = app
TARGET = qmltime
QT += qml quick
QT += quick-private
@@ -12,3 +11,5 @@ QMAKE_TARGET_DESCRIPTION = QML Time
SOURCES += qmltime.cpp
HEADERS += qmltime.h
+
+load(qt_tool)
--
2.31.1

View File

@ -0,0 +1,102 @@
From 35608b36b284000f5871deb6a0d58113110e01e8 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
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
using QVariant::value<bool>, one needs to first extract the QJSValue,
and only convert it to bool afterwards.
This is necessary due to the custom binding evaluation we're doing to
avoid state oscillation.
Amends a8c729d83979fb0b9939044d246e73b1d578e65b.
Fixes: QTBUG-105000
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I4b093b48edecf9e0f09d2b54d10c2ff527f24ac3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 2c31d25a44b1221c151681e1bb68ef78618e0166)
---
src/quick/util/qquickstategroup.cpp | 10 ++++++++--
.../quick/qquickstates/data/jsValueWhen.qml | 18 ++++++++++++++++++
.../quick/qquickstates/tst_qquickstates.cpp | 11 +++++++++++
3 files changed, 37 insertions(+), 2 deletions(-)
create mode 100644 tests/auto/quick/qquickstates/data/jsValueWhen.qml
diff --git a/src/quick/util/qquickstategroup.cpp b/src/quick/util/qquickstategroup.cpp
index 7cb3138618..f732b1eb4a 100644
--- a/src/quick/util/qquickstategroup.cpp
+++ b/src/quick/util/qquickstategroup.cpp
@@ -381,8 +381,14 @@ bool QQuickStateGroupPrivate::updateAutoState()
const auto potentialWhenBinding = QQmlPropertyPrivate::binding(whenProp);
// if there is a binding, the value in when might not be up-to-date at this point
// so we manually reevaluate the binding
- if (auto abstractBinding = dynamic_cast<QQmlBinding *>(potentialWhenBinding))
- whenValue = abstractBinding->evaluate().toBool();
+ if (auto abstractBinding = dynamic_cast<QQmlBinding *>(potentialWhenBinding)) {
+ QVariant evalResult = abstractBinding->evaluate();
+ if (evalResult.userType() == qMetaTypeId<QJSValue>())
+ whenValue = evalResult.value<QJSValue>().toBool();
+ else
+ whenValue = evalResult.toBool();
+ }
+
if (whenValue) {
if (stateChangeDebug())
qWarning() << "Setting auto state due to expression";
diff --git a/tests/auto/quick/qquickstates/data/jsValueWhen.qml b/tests/auto/quick/qquickstates/data/jsValueWhen.qml
new file mode 100644
index 0000000000..6d5eb1600c
--- /dev/null
+++ b/tests/auto/quick/qquickstates/data/jsValueWhen.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.15
+
+Item {
+ id: root
+ property var prop: null
+ property bool works: false
+ states: [
+ State {
+ name: "mystate"
+ when: root.prop
+ PropertyChanges {
+ target: root
+ works: "works"
+ }
+ }
+ ]
+ Component.onCompleted: root.prop = new Object
+}
diff --git a/tests/auto/quick/qquickstates/tst_qquickstates.cpp b/tests/auto/quick/qquickstates/tst_qquickstates.cpp
index aa55b42935..26e86672b0 100644
--- a/tests/auto/quick/qquickstates/tst_qquickstates.cpp
+++ b/tests/auto/quick/qquickstates/tst_qquickstates.cpp
@@ -188,6 +188,7 @@ private slots:
void revertListMemoryLeak();
void duplicateStateName();
void trivialWhen();
+ void jsValueWhen();
void noStateOsciallation();
void parentChangeCorrectReversal();
void revertNullObjectBinding();
@@ -1734,6 +1735,16 @@ void tst_qquickstates::trivialWhen()
QVERIFY(c.create());
}
+void tst_qquickstates::jsValueWhen()
+{
+ QQmlEngine engine;
+
+ QQmlComponent c(&engine, testFileUrl("jsValueWhen.qml"));
+ QScopedPointer<QObject> root(c.create());
+ QVERIFY(root);
+ QVERIFY(root->property("works").toBool());
+}
+
void tst_qquickstates::noStateOsciallation()
{
QQmlEngine engine;
--
2.40.1

View File

@ -1,71 +0,0 @@
From 83100a84f2b0068b4cf725896bbb810415908334 Mon Sep 17 00:00:00 2001
From: Maximilian Goldstein <max.goldstein@qt.io>
Date: Tue, 8 Dec 2020 09:26:36 +0100
Subject: [PATCH 18/28] qqmlistmodel: Fix crash when modelCache is null
Fixes: QTBUG-89173
Change-Id: Ife82518808fc5504ec42407e80ed3de89ed4adeb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c3860cd04bbc089ef95bc441a1f8f1e46f9606f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
src/qmlmodels/qqmllistmodel.cpp | 2 +-
.../qml/qqmllistmodel/tst_qqmllistmodel.cpp | 22 +++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/src/qmlmodels/qqmllistmodel.cpp b/src/qmlmodels/qqmllistmodel.cpp
index e07951cab3..8830e08097 100644
--- a/src/qmlmodels/qqmllistmodel.cpp
+++ b/src/qmlmodels/qqmllistmodel.cpp
@@ -703,7 +703,7 @@ void ListModel::set(int elementIndex, QV4::Object *object, ListModel::SetElement
} else if (propertyValue->isNullOrUndefined()) {
if (reason == SetElement::WasJustInserted) {
QQmlError err;
- auto memberName = propertyName->toString(m_modelCache->engine())->toQString();
+ auto memberName = propertyName->toString(v4)->toQString();
err.setDescription(QString::fromLatin1("%1 is %2. Adding an object with a %2 member does not create a role for it.").arg(memberName, propertyValue->isNull() ? QLatin1String("null") : QLatin1String("undefined")));
qmlWarning(nullptr, err);
} else {
diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
index d54e3467b7..1953798a15 100644
--- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
+++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
@@ -130,6 +130,7 @@ private slots:
void dynamic_roles_crash_QTBUG_38907();
void nestedListModelIteration();
void undefinedAppendShouldCauseError();
+ void nullPropertyCrash();
};
bool tst_qqmllistmodel::compareVariantList(const QVariantList &testList, QVariant object)
@@ -1723,6 +1724,27 @@ void tst_qqmllistmodel::undefinedAppendShouldCauseError()
QScopedPointer<QObject>(component.create());
}
+// QTBUG-89173
+void tst_qqmllistmodel::nullPropertyCrash()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.setData(
+ R"(import QtQuick 2.15
+ ListView {
+ model: ListModel { id: listModel }
+
+ delegate: Item {}
+
+ Component.onCompleted: {
+ listModel.append({"a": "value1", "b":[{"c":"value2"}]})
+ listModel.append({"a": "value2", "b":[{"c":null}]})
+ }
+ })",
+ QUrl());
+ QTest::ignoreMessage(QtMsgType::QtWarningMsg, "<Unknown File>: c is null. Adding an object with a null member does not create a role for it.");
+ QScopedPointer<QObject>(component.create());
+}
QTEST_MAIN(tst_qqmllistmodel)
--
2.31.1

View File

@ -0,0 +1,162 @@
From 32730dad9adcaab137cf2fe434b03be23bbe9c7d 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
Pick-to: 6.5 6.2 5.15
Fixes: QTBUG-91425
Change-Id: I58cf9ee29922f83fc6621f771b80ed557b31f106
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 0cfdecba54e4f40468c4c9a8a6668cc1bc0eff65)
* asturmlechner 2023-04-08: Resolve conflict with dev branch commit
c2d490a2385ea6f389340a296acaac0fa198c8b9 (qAsConst to std::as_const)
---
src/qmlmodels/qqmldelegatemodel.cpp | 23 ++++++---
.../qml/qqmldelegatemodel/data/deleteRace.qml | 50 +++++++++++++++++++
.../tst_qqmldelegatemodel.cpp | 12 +++++
3 files changed, 78 insertions(+), 7 deletions(-)
create mode 100644 tests/auto/qml/qqmldelegatemodel/data/deleteRace.qml
diff --git a/src/qmlmodels/qqmldelegatemodel.cpp b/src/qmlmodels/qqmldelegatemodel.cpp
index 4157899aa6..5b7e767ae2 100644
--- a/src/qmlmodels/qqmldelegatemodel.cpp
+++ b/src/qmlmodels/qqmldelegatemodel.cpp
@@ -1883,10 +1883,15 @@ void QQmlDelegateModelPrivate::emitChanges()
for (int i = 1; i < m_groupCount; ++i)
QQmlDelegateModelGroupPrivate::get(m_groups[i])->emitModelUpdated(reset);
- auto cacheCopy = m_cache; // deliberate; emitChanges may alter m_cache
- for (QQmlDelegateModelItem *cacheItem : qAsConst(cacheCopy)) {
- if (cacheItem->attached)
- cacheItem->attached->emitChanges();
+ // emitChanges may alter m_cache and delete items
+ QVarLengthArray<QPointer<QQmlDelegateModelAttached>> attachedObjects;
+ attachedObjects.reserve(m_cache.length());
+ for (const QQmlDelegateModelItem *cacheItem : qAsConst(m_cache))
+ attachedObjects.append(cacheItem->attached);
+
+ for (const QPointer<QQmlDelegateModelAttached> &attached : qAsConst(attachedObjects)) {
+ if (attached && attached->m_cacheItem)
+ attached->emitChanges();
}
}
@@ -2707,20 +2712,24 @@ void QQmlDelegateModelAttached::emitChanges()
m_previousGroups = m_cacheItem->groups;
int indexChanges = 0;
- for (int i = 1; i < m_cacheItem->metaType->groupCount; ++i) {
+ const int groupCount = m_cacheItem->metaType->groupCount;
+ for (int i = 1; i < groupCount; ++i) {
if (m_previousIndex[i] != m_currentIndex[i]) {
m_previousIndex[i] = m_currentIndex[i];
indexChanges |= (1 << i);
}
}
+ // Don't access m_cacheItem anymore once we've started sending signals.
+ // We don't own it and someone might delete it.
+
int notifierId = 0;
const QMetaObject *meta = metaObject();
- for (int i = 1; i < m_cacheItem->metaType->groupCount; ++i, ++notifierId) {
+ for (int i = 1; i < groupCount; ++i, ++notifierId) {
if (groupChanges & (1 << i))
QMetaObject::activate(this, meta, notifierId, nullptr);
}
- for (int i = 1; i < m_cacheItem->metaType->groupCount; ++i, ++notifierId) {
+ for (int i = 1; i < groupCount; ++i, ++notifierId) {
if (indexChanges & (1 << i))
QMetaObject::activate(this, meta, notifierId, nullptr);
}
diff --git a/tests/auto/qml/qqmldelegatemodel/data/deleteRace.qml b/tests/auto/qml/qqmldelegatemodel/data/deleteRace.qml
new file mode 100644
index 0000000000..23874970e7
--- /dev/null
+++ b/tests/auto/qml/qqmldelegatemodel/data/deleteRace.qml
@@ -0,0 +1,50 @@
+import QtQuick 2.15
+import QtQml.Models 2.15
+
+Item {
+ DelegateModel {
+ id: delegateModel
+ model: ListModel {
+ id: sourceModel
+
+ ListElement { title: "foo" }
+ ListElement { title: "bar" }
+
+ function clear() {
+ if (count > 0)
+ remove(0, count);
+ }
+ }
+
+ groups: [
+ DelegateModelGroup { name: "selectedItems" }
+ ]
+
+ delegate: Text {
+ height: DelegateModel.inSelectedItems ? implicitHeight * 2 : implicitHeight
+ Component.onCompleted: {
+ if (index === 0)
+ DelegateModel.inSelectedItems = true;
+ }
+ }
+
+ Component.onCompleted: {
+ items.create(0)
+ items.create(1)
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: delegateModel
+ }
+
+ Timer {
+ running: true
+ interval: 10
+ onTriggered: sourceModel.clear()
+ }
+
+ property int count: delegateModel.items.count
+}
+
diff --git a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
index 1722447830..f473cff75f 100644
--- a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
+++ b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
@@ -50,6 +50,7 @@ private slots:
void qtbug_86017();
void contextAccessedByHandler();
void redrawUponColumnChange();
+ void deleteRace();
};
class AbstractItemModel : public QAbstractItemModel
@@ -213,6 +214,17 @@ void tst_QQmlDelegateModel::redrawUponColumnChange()
QCOMPARE(item->property("text").toString(), "Coconut");
}
+void tst_QQmlDelegateModel::deleteRace()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("deleteRace.qml"));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(!o.isNull());
+ QTRY_COMPARE(o->property("count").toInt(), 2);
+ QTRY_COMPARE(o->property("count").toInt(), 0);
+}
+
QTEST_MAIN(tst_QQmlDelegateModel)
#include "tst_qqmldelegatemodel.moc"
--
2.40.1

View File

@ -1,101 +0,0 @@
From 1241e4f3c3ec010ae121f5d56c3e9405ec43231f Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@qt.io>
Date: Fri, 6 Nov 2020 13:30:12 +0100
Subject: [PATCH 19/28] Show a tableview even if the syncView has an empty
model
By showing the tableview, we can be sure that headerviews will be
visible even in the syncView has an empty model.
Fixes: QTBUG-87526
Change-Id: I68c8b119122a2d2f88c2afbeb2d6c71a83a3ce33
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 27c254203b3e7dd6d3a4445feb205fbe98c32d30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
src/quick/items/qquicktableview.cpp | 7 +--
.../qquicktableview/tst_qquicktableview.cpp | 43 +++++++++++++++++++
2 files changed, 45 insertions(+), 5 deletions(-)
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp
index 7b73fcb393..1349d308d7 100644
--- a/src/quick/items/qquicktableview.cpp
+++ b/src/quick/items/qquicktableview.cpp
@@ -1760,11 +1760,8 @@ void QQuickTableViewPrivate::calculateTopLeft(QPoint &topLeftCell, QPointF &topL
const auto syncView_d = syncView->d_func();
if (syncView_d->loadedItems.isEmpty()) {
- // The sync view contains no loaded items. This probably means
- // that it has not been rebuilt yet. Which also means that
- // we cannot rebuild anything before this happens.
- topLeftCell.rx() = kEdgeIndexNotSet;
- topLeftCell.ry() = kEdgeIndexNotSet;
+ topLeftCell.rx() = 0;
+ topLeftCell.ry() = 0;
return;
}
diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
index 54f73c6e0c..d489a873e4 100644
--- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
+++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
@@ -176,6 +176,7 @@ private slots:
void checkSyncView_connect_late_data();
void checkSyncView_connect_late();
void checkSyncView_pageFlicking();
+ void checkSyncView_emptyModel();
void delegateWithRequiredProperties();
void checkThatFetchMoreIsCalledWhenScrolledToTheEndOfTable();
void replaceModel();
@@ -2731,6 +2732,48 @@ void tst_QQuickTableView::checkSyncView_pageFlicking()
QVERIFY(tableViewPrivate->scheduledRebuildOptions & QQuickTableViewPrivate::RebuildOption::CalculateNewTopLeftRow);
}
+void tst_QQuickTableView::checkSyncView_emptyModel()
+{
+ // When a tableview has a syncview with an empty model then it should still be
+ // showing the tableview without depending on the syncview. This is particularly
+ // important for headerviews for example
+ LOAD_TABLEVIEW("syncviewsimple.qml");
+ GET_QML_TABLEVIEW(tableViewH);
+ GET_QML_TABLEVIEW(tableViewV);
+ GET_QML_TABLEVIEW(tableViewHV);
+ QQuickTableView *views[] = {tableViewH, tableViewV, tableViewHV};
+
+ auto model = TestModelAsVariant(100, 100);
+
+ for (auto view : views)
+ view->setModel(model);
+
+ WAIT_UNTIL_POLISHED_ARG(tableViewHV);
+
+ // Check that geometry properties are mirrored
+ QCOMPARE(tableViewH->columnSpacing(), tableView->columnSpacing());
+ QCOMPARE(tableViewH->rowSpacing(), 0);
+ QCOMPARE(tableViewH->contentWidth(), tableView->contentWidth());
+ QVERIFY(tableViewH->contentHeight() > 0);
+ QCOMPARE(tableViewV->columnSpacing(), 0);
+ QCOMPARE(tableViewV->rowSpacing(), tableView->rowSpacing());
+ QCOMPARE(tableViewV->contentHeight(), tableView->contentHeight());
+ QVERIFY(tableViewV->contentWidth() > 0);
+
+ QCOMPARE(tableViewH->contentX(), tableView->contentX());
+ QCOMPARE(tableViewH->contentY(), 0);
+ QCOMPARE(tableViewV->contentX(), 0);
+ QCOMPARE(tableViewV->contentY(), tableView->contentY());
+ QCOMPARE(tableViewHV->contentX(), tableView->contentX());
+ QCOMPARE(tableViewHV->contentY(), tableView->contentY());
+
+ QCOMPARE(tableViewHPrivate->loadedTableOuterRect.left(), tableViewPrivate->loadedTableOuterRect.left());
+ QCOMPARE(tableViewHPrivate->loadedTableOuterRect.top(), 0);
+
+ QCOMPARE(tableViewVPrivate->loadedTableOuterRect.top(), tableViewPrivate->loadedTableOuterRect.top());
+ QCOMPARE(tableViewVPrivate->loadedTableOuterRect.left(), 0);
+}
+
void tst_QQuickTableView::checkThatFetchMoreIsCalledWhenScrolledToTheEndOfTable()
{
LOAD_TABLEVIEW("plaintableview.qml");
--
2.31.1

View File

@ -1,58 +0,0 @@
From 5e0ba6b797ca7843609fc19d8c4c96f6f26aacd2 Mon Sep 17 00:00:00 2001
From: Miikka Heikkinen <miikka.heikkinen@qt.io>
Date: Tue, 15 Dec 2020 12:43:40 +0200
Subject: [PATCH 20/28] DesignerSupport: Don't skip already inspected objects
Already inspected objects should not be skipped when determining their
properties, as recursive call will always have different base name for
the properties.
Internally we don't need inspectedObjects list at all anymore, but
it's kept to avoid changing API and in case the caller is interested
in inspected objects.
Fixes: QDS-3301
Change-Id: I76198b96d420e2a5ae6b13cfee65df4bce22d8f5
Pick-to: dev
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
---
.../designer/qquickdesignersupportproperties.cpp | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/src/quick/designer/qquickdesignersupportproperties.cpp b/src/quick/designer/qquickdesignersupportproperties.cpp
index 335795acf1..fb6a5fb324 100644
--- a/src/quick/designer/qquickdesignersupportproperties.cpp
+++ b/src/quick/designer/qquickdesignersupportproperties.cpp
@@ -137,11 +137,8 @@ QQuickDesignerSupport::PropertyNameList QQuickDesignerSupportProperties::propert
if (inspectedObjects == nullptr)
inspectedObjects = &localObjectList;
-
- if (inspectedObjects->contains(object))
- return propertyNameList;
-
- inspectedObjects->append(object);
+ if (!inspectedObjects->contains(object))
+ inspectedObjects->append(object);
const QMetaObject *metaObject = object->metaObject();
for (int index = 0; index < metaObject->propertyCount(); ++index) {
@@ -194,12 +191,8 @@ QQuickDesignerSupport::PropertyNameList QQuickDesignerSupportProperties::allProp
if (inspectedObjects == nullptr)
inspectedObjects = &localObjectList;
-
- if (inspectedObjects->contains(object))
- return propertyNameList;
-
- inspectedObjects->append(object);
-
+ if (!inspectedObjects->contains(object))
+ inspectedObjects->append(object);
const QMetaObject *metaObject = object->metaObject();
--
2.31.1

View File

@ -0,0 +1,35 @@
From adad56c92c633248f0fe467f8e0c32dc461f6716 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
invalidated
Function::updateInternalClass creates a reference to a QStringList that is appended to before being used.
This is unsafe and can leads to a segfault if the append() causes a reallocation.
Fixes: QTBUG-94360
Pick-to: 5.15 6.1 6.2
Change-Id: Iac49e8d816cf440ca2b70e133c88314eb8df6b91
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit 7fa28f98824a94396106eadfc028b329985a0cfc)
---
src/qml/jsruntime/qv4function.cpp | 2 +-
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
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -136,7 +136,7 @@ void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArr
if (duplicate == -1) {
parameterNames.append(QString::fromUtf8(param));
} else {
- const QString &dup = parameterNames[duplicate];
+ const QString dup = parameterNames[duplicate];
parameterNames.append(dup);
parameterNames[duplicate] =
QString(0xfffe) + QString::number(duplicate) + dup;
--
2.40.1

View File

@ -1,114 +0,0 @@
From 5a7aa7881fa2c7abffb3d34a6b642fe4efcadbf4 Mon Sep 17 00:00:00 2001
From: Fabian Kosmale <fabian.kosmale@qt.io>
Date: Thu, 17 Dec 2020 11:22:34 +0100
Subject: [PATCH 21/28] QML: Fix proxy iteration
If the target of a proxy was extensible, we did not set the
iteratorTarget to its correct value, and thus the ForInIteratorObject
would not be usable.
Fixes: QTBUG-86323
Change-Id: Id1924ac4087bab38c006b8eba92b619b79d36b7a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit dd740d6b3469448dc1fd31c1742781e923e9f274)
---
src/qml/jsruntime/qv4proxy.cpp | 8 +++--
.../qqmlecmascript/data/proxyIteration.qml | 29 +++++++++++++++++++
.../qml/qqmlecmascript/tst_qqmlecmascript.cpp | 10 +++++++
3 files changed, 45 insertions(+), 2 deletions(-)
create mode 100644 tests/auto/qml/qqmlecmascript/data/proxyIteration.qml
diff --git a/src/qml/jsruntime/qv4proxy.cpp b/src/qml/jsruntime/qv4proxy.cpp
index 1505eae426..8bfc9fc3ba 100644
--- a/src/qml/jsruntime/qv4proxy.cpp
+++ b/src/qml/jsruntime/qv4proxy.cpp
@@ -624,8 +624,10 @@ OwnPropertyKeyIterator *ProxyObject::virtualOwnPropertyKeys(const Object *m, Val
else
targetNonConfigurableKeys->push_back(keyAsValue);
}
- if (target->isExtensible() && targetNonConfigurableKeys->getLength() == 0)
+ if (target->isExtensible() && targetNonConfigurableKeys->getLength() == 0) {
+ *iteratorTarget = *m;
return new ProxyObjectOwnPropertyKeyIterator(trapKeys);
+ }
ScopedArrayObject uncheckedResultKeys(scope, scope.engine->newArrayObject());
uncheckedResultKeys->copyArrayData(trapKeys);
@@ -639,8 +641,10 @@ OwnPropertyKeyIterator *ProxyObject::virtualOwnPropertyKeys(const Object *m, Val
}
}
- if (target->isExtensible())
+ if (target->isExtensible()) {
+ *iteratorTarget = *m;
return new ProxyObjectOwnPropertyKeyIterator(trapKeys);
+ }
len = targetConfigurableKeys->getLength();
for (uint i = 0; i < len; ++i) {
diff --git a/tests/auto/qml/qqmlecmascript/data/proxyIteration.qml b/tests/auto/qml/qqmlecmascript/data/proxyIteration.qml
new file mode 100644
index 0000000000..affba7d9f1
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/proxyIteration.qml
@@ -0,0 +1,29 @@
+import QtQml 2
+
+QtObject {
+ id: root
+ property int sum
+ Component.onCompleted: {
+ const target = { prop1: 1, prop2: 2, prop3: 3 };
+ const handler = {
+ get: function(target, key) {
+ return target[key]+1;
+ },
+ ownKeys: function() {
+ return ["prop1", "prop3"];
+ },
+ getOwnPropertyDescriptor: function(target, key) {
+ return {
+ value: this.get(target, key),
+ enumerable: true,
+ configurable: true
+ };
+ }
+ };
+ const proxy = new Proxy(target, handler);
+ for (var prop in proxy) {
+ root.sum += proxy[prop] // prop2 gets skipped, the values of 1 and 3 get incremented
+ }
+ // so root.sum should be 6 now
+ }
+}
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 3a9d1bfb4c..9198d3bebf 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -382,6 +382,7 @@ private slots:
void semicolonAfterProperty();
void hugeStack();
void variantConversionMethod();
+ void proxyIteration();
void proxyHandlerTraps();
void gcCrashRegressionTest();
@@ -9306,6 +9307,15 @@ void tst_qqmlecmascript::variantConversionMethod()
QCOMPARE(obj.funcCalled, QLatin1String("QModelIndex"));
}
+void tst_qqmlecmascript::proxyIteration()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("proxyIteration.qml"));
+ QScopedPointer<QObject> root(component.create());
+ QVERIFY2(root != nullptr, qPrintable(component.errorString()));
+ QCOMPARE(root->property("sum").toInt(), 6);
+}
+
void tst_qqmlecmascript::proxyHandlerTraps()
{
const QString expression = QStringLiteral(R"SNIPPET(
--
2.31.1

View File

@ -0,0 +1,141 @@
From cc1b9e7d4aac93d0767e83431be5a5aebcdffb59 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
SwipeDelegate causes the running animation job to be deleted when
calling swipe.close in swipe.completed. Employ the RETURN_IF_DELETED
check in more places to avoid crashes.
Fixes: QTBUG-100560
Task-number: QTBUG-103223
Pick-to: 6.3 6.2 5.15
Change-Id: I276eeaa9aed1bdb36449b322a24641fa02c4d5e4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 0238af0bd48b831d72126f2228d5913eccf67bae)
* asturmlechner 2023-04-09: Resolve conflict with dev branch commit
4938984f9a779192264757a06e6ca555fc8f5e91
---
.../qcontinuinganimationgroupjob.cpp | 4 +-
.../animations/qparallelanimationgroupjob.cpp | 4 +-
.../swipedelegate/CloseOnCompletedWorks.qml | 74 +++++++++++++++++++
3 files changed, 78 insertions(+), 4 deletions(-)
create mode 100644 tests/manual/quickcontrols2/swipedelegate/CloseOnCompletedWorks.qml
diff --git a/src/qml/animations/qcontinuinganimationgroupjob.cpp b/src/qml/animations/qcontinuinganimationgroupjob.cpp
index 88c0e9e60e..61a9dc36f8 100644
--- a/src/qml/animations/qcontinuinganimationgroupjob.cpp
+++ b/src/qml/animations/qcontinuinganimationgroupjob.cpp
@@ -82,9 +82,9 @@ void QContinuingAnimationGroupJob::updateState(QAbstractAnimationJob::State newS
return;
}
for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
- resetUncontrolledAnimationFinishTime(animation);
+ RETURN_IF_DELETED(resetUncontrolledAnimationFinishTime(animation));
animation->setDirection(m_direction);
- animation->start();
+ RETURN_IF_DELETED(animation->start());
}
break;
}
diff --git a/src/qml/animations/qparallelanimationgroupjob.cpp b/src/qml/animations/qparallelanimationgroupjob.cpp
index 420a934ba2..a828d0e234 100644
--- a/src/qml/animations/qparallelanimationgroupjob.cpp
+++ b/src/qml/animations/qparallelanimationgroupjob.cpp
@@ -144,10 +144,10 @@ void QParallelAnimationGroupJob::updateState(QAbstractAnimationJob::State newSta
animation->stop();
m_previousLoop = m_direction == Forward ? 0 : m_loopCount - 1;
}
- resetUncontrolledAnimationFinishTime(animation);
+ RETURN_IF_DELETED(resetUncontrolledAnimationFinishTime(animation));
animation->setDirection(m_direction);
if (shouldAnimationStart(animation, oldState == Stopped))
- animation->start();
+ RETURN_IF_DELETED(animation->start());
}
break;
}
diff --git a/tests/manual/quickcontrols2/swipedelegate/CloseOnCompletedWorks.qml b/tests/manual/quickcontrols2/swipedelegate/CloseOnCompletedWorks.qml
new file mode 100644
index 0000000000..38dfde41c3
--- /dev/null
+++ b/tests/manual/quickcontrols2/swipedelegate/CloseOnCompletedWorks.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2
+import QtQuick.Controls 2
+ApplicationWindow {
+ visible: true
+ width: 640
+ height: 480
+
+ ListView {
+ anchors.fill: parent
+ model: 2
+
+ delegate: SwipeDelegate {
+ text: "Swipe me left (should not crash)"
+
+ swipe.right: Label {
+ text: "Release (should not crash)"
+ }
+
+ swipe.onCompleted: {
+ swipe.close()
+ }
+ }
+ }
+}
--
2.40.1

View File

@ -1,146 +0,0 @@
From bb0ce1ffd48aa69da03dc43bd314351519ebf0d7 Mon Sep 17 00:00:00 2001
From: Fabian Kosmale <fabian.kosmale@qt.io>
Date: Tue, 8 Dec 2020 14:12:47 +0100
Subject: [PATCH 22/28] Fix IC properties in same file
Also fixes typename and metatype registration for inline components.
Done-with: Fabian Kosmale <fabian.kosmale@qt.io>
Fixes: QTBUG-89173
Change-Id: I97d65d5539b577a8828d5711e5f2e79c8568b441
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit c2ca14ce22551ea72544b6e2b3a19823b6dc3050)
---
src/qml/qml/qqmlpropertycachecreator.cpp | 9 +++++++
src/qml/qml/qqmlpropertycachecreator_p.h | 2 ++
src/qml/qml/qqmlpropertyvalidator.cpp | 25 +++++++++++++++++++
src/qml/qml/qqmltypedata.cpp | 4 +--
.../data/inlineComponentsSameFile.qml | 11 ++++++++
.../qml/qqmllanguage/tst_qqmllanguage.cpp | 1 +
6 files changed, 49 insertions(+), 3 deletions(-)
create mode 100644 tests/auto/qml/qqmllanguage/data/inlineComponentsSameFile.qml
diff --git a/src/qml/qml/qqmlpropertycachecreator.cpp b/src/qml/qml/qqmlpropertycachecreator.cpp
index 36581bda4e..88d80d88ab 100644
--- a/src/qml/qml/qqmlpropertycachecreator.cpp
+++ b/src/qml/qml/qqmlpropertycachecreator.cpp
@@ -90,6 +90,15 @@ QByteArray QQmlPropertyCacheCreatorBase::createClassNameTypeByUrl(const QUrl &ur
QByteArray::number(classIndexCounter.fetchAndAddRelaxed(1));
}
+QByteArray QQmlPropertyCacheCreatorBase::createClassNameForInlineComponent(const QUrl &baseUrl, int icId)
+{
+ QByteArray baseName = createClassNameTypeByUrl(baseUrl);
+ if (baseName.isEmpty())
+ baseName = QByteArray("ANON_QML_IC_") + QByteArray::number(classIndexCounter.fetchAndAddRelaxed(1));
+ baseName += "_" + QByteArray::number(icId);
+ return baseName;
+}
+
QQmlBindingInstantiationContext::QQmlBindingInstantiationContext(int referencingObjectIndex, const QV4::CompiledData::Binding *instantiatingBinding,
const QString &instantiatingPropertyName, QQmlPropertyCache *referencingObjectPropertyCache)
: referencingObjectIndex(referencingObjectIndex)
diff --git a/src/qml/qml/qqmlpropertycachecreator_p.h b/src/qml/qml/qqmlpropertycachecreator_p.h
index 6b02d6fb98..77e3763a49 100644
--- a/src/qml/qml/qqmlpropertycachecreator_p.h
+++ b/src/qml/qml/qqmlpropertycachecreator_p.h
@@ -104,6 +104,8 @@ public:
static int metaTypeForPropertyType(QV4::CompiledData::BuiltinType type);
static QByteArray createClassNameTypeByUrl(const QUrl &url);
+
+ static QByteArray createClassNameForInlineComponent(const QUrl &baseUrl, int icId);
};
template <typename ObjectContainer>
diff --git a/src/qml/qml/qqmlpropertyvalidator.cpp b/src/qml/qml/qqmlpropertyvalidator.cpp
index 3587609301..3a1f33113f 100644
--- a/src/qml/qml/qqmlpropertyvalidator.cpp
+++ b/src/qml/qml/qqmlpropertyvalidator.cpp
@@ -651,6 +651,19 @@ bool QQmlPropertyValidator::canCoerce(int to, QQmlPropertyCache *fromMo) const
{
QQmlPropertyCache *toMo = enginePrivate->rawPropertyCacheForType(to);
+ if (toMo == nullptr) {
+ // if we have an inline component from the current file,
+ // it is not properly registered at this point, as registration
+ // only occurs after the whole file has been validated
+ // Therefore we need to check the ICs here
+ for (const auto& icDatum : compilationUnit->inlineComponentData) {
+ if (icDatum.typeIds.id == to) {
+ toMo = compilationUnit->propertyCaches.at(icDatum.objectIndex);
+ break;
+ }
+ }
+ }
+
while (fromMo) {
if (fromMo == toMo)
return true;
@@ -746,6 +759,18 @@ QQmlError QQmlPropertyValidator::validateObjectBinding(QQmlPropertyData *propert
// effect the properties on the type, but don't effect assignability
// Using -1 for the minor version ensures that we get the raw metaObject.
QQmlPropertyCache *propertyMetaObject = enginePrivate->rawPropertyCacheForType(propType, -1);
+ if (!propertyMetaObject) {
+ // if we have an inline component from the current file,
+ // it is not properly registered at this point, as registration
+ // only occurs after the whole file has been validated
+ // Therefore we need to check the ICs here
+ for (const auto& icDatum: compilationUnit->inlineComponentData) {
+ if (icDatum.typeIds.id == property->propType()) {
+ propertyMetaObject = compilationUnit->propertyCaches.at(icDatum.objectIndex);
+ break;
+ }
+ }
+ }
if (propertyMetaObject) {
// Will be true if the assigned type inherits propertyMetaObject
diff --git a/src/qml/qml/qqmltypedata.cpp b/src/qml/qml/qqmltypedata.cpp
index fc1d0cfbcf..92a90ea677 100644
--- a/src/qml/qml/qqmltypedata.cpp
+++ b/src/qml/qml/qqmltypedata.cpp
@@ -283,9 +283,7 @@ void setupICs(const ObjectContainer &container, QHash<int, InlineComponentData>
for (int i = 0; i != container->objectCount(); ++i) {
auto root = container->objectAt(i);
for (auto it = root->inlineComponentsBegin(); it != root->inlineComponentsEnd(); ++it) {
- auto url = finalUrl;
- url.setFragment(QString::number(it->objectIndex));
- const QByteArray &className = QQmlPropertyCacheCreatorBase::createClassNameTypeByUrl(url);
+ const QByteArray &className = QQmlPropertyCacheCreatorBase::createClassNameForInlineComponent(finalUrl, it->objectIndex);
InlineComponentData icDatum(QQmlMetaType::registerInternalCompositeType(className), int(it->objectIndex), int(it->nameIndex), 0, 0, 0);
icData->insert(it->objectIndex, icDatum);
}
diff --git a/tests/auto/qml/qqmllanguage/data/inlineComponentsSameFile.qml b/tests/auto/qml/qqmllanguage/data/inlineComponentsSameFile.qml
new file mode 100644
index 0000000000..87cac10200
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/inlineComponentsSameFile.qml
@@ -0,0 +1,11 @@
+import QtQml 2.15
+
+QtObject {
+ component IC : QtObject {
+ property string name
+ property int age
+ }
+
+ property IC other: IC { name: "Toby"; age: 30 }
+ property list<IC> listProp: [IC { name: "Alfred Ill"; age: 65 }, IC { name: "Claire Zachanassian"; age: 62}]
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 8adcbc1837..e247a139ec 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -5604,6 +5604,7 @@ void tst_qqmllanguage::inlineComponent_data()
QTest::newRow("Alias resolves correctly") << testFileUrl("inlineComponentWithAlias.qml") << QColorConstants::Svg::lime << 42 << true;
QTest::newRow("Two inline components in same do not crash (QTBUG-86989)") << testFileUrl("twoInlineComponents.qml") << QColor() << 0 << false;
+ QTest::newRow("Inline components used in same file (QTBUG-89173)") << testFileUrl("inlineComponentsSameFile.qml") << QColor() << 0 << false;
}
void tst_qqmllanguage::inlineComponentReferenceCycle_data()
--
2.31.1

View File

@ -0,0 +1,129 @@
From 3366947eb58c0c5ad8a7e714a6b9667e1c3ff7b8 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
Fixes: QTBUG-86255
Pick-to: 5.15
Change-Id: I30488b64d910a1409a43e2e98ee7ab084aec33d2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 149c1dd07b54ee0c027d94a49d52160dc4f4e2ac)
* asturmlechner 2023-01-06: Resolve conflict with dev branch commits
d51c007ecc8aa6256cb95cf3992e5ac34a70fa3f and
b2a4a61e8cb0839ba293783ac03c72f35c7b1307
---
src/qml/qml/qqmlvmemetaobject.cpp | 2 +-
.../quick/qquickgridview/data/qtbug86255.qml | 55 +++++++++++++++++++
.../qquickgridview/tst_qquickgridview.cpp | 13 +++++
3 files changed, 69 insertions(+), 1 deletion(-)
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
--- a/src/qml/qml/qqmlvmemetaobject.cpp
+++ b/src/qml/qml/qqmlvmemetaobject.cpp
@@ -254,7 +254,7 @@ void QQmlVMEMetaObjectEndpoint::tryConnect()
if (!pd)
return;
- if (pd->notifyIndex() != -1)
+ if (pd->notifyIndex() != -1 && ctxt->engine)
connect(target, pd->notifyIndex(), ctxt->engine);
}
diff --git a/tests/auto/quick/qquickgridview/data/qtbug86255.qml b/tests/auto/quick/qquickgridview/data/qtbug86255.qml
new file mode 100644
index 0000000000..20688b1967
--- /dev/null
+++ b/tests/auto/quick/qquickgridview/data/qtbug86255.qml
@@ -0,0 +1,55 @@
+import QtQuick 2.15
+
+Item {
+ width: 240
+ height: 320
+
+ GridView {
+ id: grid
+ objectName: "view"
+ anchors.fill: parent
+ cellWidth: 64
+ cellHeight: 64
+ model: ListModel {
+ id: listModel
+
+ Component.onCompleted: reload()
+
+ function reload() {
+ clear();
+ for (let i = 0; i < 1000; i++) {
+ let magic = Math.random();
+ append( { magic } );
+ }
+ }
+ }
+ clip: true
+ delegate: Item {
+ id: d
+ property string val: magic
+ Loader {
+ property alias value: d.val
+ asynchronous: true
+ sourceComponent: cmp
+ }
+ }
+ }
+
+ Timer {
+ running: true
+ interval: 1000
+ onTriggered: listModel.reload()
+ }
+ Timer {
+ running: true
+ interval: 500
+ onTriggered: grid.flick(0, -4000)
+ }
+
+ Component {
+ id: cmp
+ Text {
+ text: value
+ }
+ }
+}
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index 94ec4f44d5..7d0d9fa7a7 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -213,6 +213,7 @@ private slots:
void QTBUG_45640();
void QTBUG_49218();
void QTBUG_48870_fastModelUpdates();
+ void QTBUG_86255();
void keyNavigationEnabled();
void resizeDynamicCellWidthRtL();
@@ -6814,6 +6815,18 @@ void tst_QQuickGridView::resizeDynamicCellWidthRtL()
QTRY_COMPARE(gridview->contentX(), 0.f);
}
+void tst_QQuickGridView::QTBUG_86255()
+{
+ QScopedPointer<QQuickView> window(createView());
+ window->setSource(testFileUrl("qtbug86255.qml"));
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
+ QQuickGridView *view = findItem<QQuickGridView>(window->rootObject(), "view");
+ QVERIFY(view != nullptr);
+ QTRY_COMPARE(view->isFlicking(), true);
+ QTRY_COMPARE(view->isFlicking(), false);
+}
+
void tst_QQuickGridView::releaseItems()
{
QScopedPointer<QQuickView> view(createView());
--
2.40.1

View File

@ -1,201 +0,0 @@
From 35614462443c100b6753b335b58a134fed4b5c35 Mon Sep 17 00:00:00 2001
From: Ulf Hermann <ulf.hermann@qt.io>
Date: Wed, 16 Dec 2020 16:45:36 +0100
Subject: [PATCH 23/28] JIT: When making memory writable, include the exception
handler
makeWritable() rounds the memory down to the next page boundary. Usually
we include the exception handler this way, unless the offset from the
page boundary is less than the exception handler size. Make it explicit
that we do want the exception handler to be writable, too.
Fixes: QTBUG-89513
Change-Id: I2fb8fb0e1dcc3450b036924463dc1b40d2020c46
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 86a595b126bc6794380dc00af80ec4802f7d058c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
src/3rdparty/masm/assembler/AssemblerBuffer.h | 4 ++--
src/3rdparty/masm/assembler/LinkBuffer.h | 9 +++++----
.../masm/assembler/MacroAssemblerCodeRef.h | 6 +++---
src/3rdparty/masm/stubs/ExecutableAllocator.h | 11 ++++++++---
src/qml/jsruntime/qv4executableallocator.cpp | 14 ++++++++++++--
src/qml/jsruntime/qv4executableallocator_p.h | 10 ++++++++--
src/qml/jsruntime/qv4functiontable_win64.cpp | 4 ++--
7 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/src/3rdparty/masm/assembler/AssemblerBuffer.h b/src/3rdparty/masm/assembler/AssemblerBuffer.h
index 45874235b6..2292a4c244 100644
--- a/src/3rdparty/masm/assembler/AssemblerBuffer.h
+++ b/src/3rdparty/masm/assembler/AssemblerBuffer.h
@@ -140,9 +140,9 @@ namespace JSC {
if (!result)
return 0;
- ExecutableAllocator::makeWritable(result->start(), result->sizeInBytes());
+ ExecutableAllocator::makeWritable(result->memoryStart(), result->memorySize());
- memcpy(result->start(), m_buffer, m_index);
+ memcpy(result->codeStart(), m_buffer, m_index);
return result.release();
}
diff --git a/src/3rdparty/masm/assembler/LinkBuffer.h b/src/3rdparty/masm/assembler/LinkBuffer.h
index ba57564a1d..fa669deaf9 100644
--- a/src/3rdparty/masm/assembler/LinkBuffer.h
+++ b/src/3rdparty/masm/assembler/LinkBuffer.h
@@ -333,7 +333,7 @@ inline void LinkBufferBase<MacroAssembler, ExecutableOffsetCalculator>::linkCode
m_executableMemory = m_assembler->m_assembler.executableCopy(*m_globalData, ownerUID, effort);
if (!m_executableMemory)
return;
- m_code = m_executableMemory->start();
+ m_code = m_executableMemory->codeStart();
m_size = m_assembler->m_assembler.codeSize();
ASSERT(m_code);
}
@@ -355,7 +355,8 @@ void LinkBufferBase<MacroAssembler, ExecutableOffsetCalculator>::performFinaliza
template <typename MacroAssembler, template <typename T> class ExecutableOffsetCalculator>
inline void LinkBufferBase<MacroAssembler, ExecutableOffsetCalculator>::makeExecutable()
{
- ExecutableAllocator::makeExecutable(code(), static_cast<int>(m_size));
+ ExecutableAllocator::makeExecutable(m_executableMemory->memoryStart(),
+ m_executableMemory->memorySize());
}
template <typename MacroAssembler>
@@ -442,9 +443,9 @@ inline void BranchCompactingLinkBuffer<MacroAssembler>::linkCode(void* ownerUID,
m_executableMemory = m_globalData->executableAllocator.allocate(*m_globalData, m_initialSize, ownerUID, effort);
if (!m_executableMemory)
return;
- m_code = (uint8_t*)m_executableMemory->start();
+ m_code = (uint8_t*)m_executableMemory->codeStart();
ASSERT(m_code);
- ExecutableAllocator::makeWritable(m_code, m_initialSize);
+ ExecutableAllocator::makeWritable(m_executableMemory->memoryStart(), m_executableMemory->memorySize());
uint8_t* inData = (uint8_t*)m_assembler->unlinkedCode();
uint8_t* outData = reinterpret_cast<uint8_t*>(m_code);
int readPtr = 0;
diff --git a/src/3rdparty/masm/assembler/MacroAssemblerCodeRef.h b/src/3rdparty/masm/assembler/MacroAssemblerCodeRef.h
index a7e78ad78f..cde9751108 100644
--- a/src/3rdparty/masm/assembler/MacroAssemblerCodeRef.h
+++ b/src/3rdparty/masm/assembler/MacroAssemblerCodeRef.h
@@ -357,11 +357,11 @@ public:
}
MacroAssemblerCodeRef(PassRefPtr<ExecutableMemoryHandle> executableMemory)
- : m_codePtr(executableMemory->start())
+ : m_codePtr(executableMemory->codeStart())
, m_executableMemory(executableMemory)
{
ASSERT(m_executableMemory->isManaged());
- ASSERT(m_executableMemory->start());
+ ASSERT(m_executableMemory->codeStart());
ASSERT(m_codePtr);
}
@@ -395,7 +395,7 @@ public:
{
if (!m_executableMemory)
return 0;
- return m_executableMemory->sizeInBytes();
+ return m_executableMemory->codeSize();
}
bool tryToDisassemble(const char* prefix) const
diff --git a/src/3rdparty/masm/stubs/ExecutableAllocator.h b/src/3rdparty/masm/stubs/ExecutableAllocator.h
index a439c53827..f984704023 100644
--- a/src/3rdparty/masm/stubs/ExecutableAllocator.h
+++ b/src/3rdparty/masm/stubs/ExecutableAllocator.h
@@ -82,9 +82,14 @@ struct ExecutableMemoryHandle : public RefCounted<ExecutableMemoryHandle> {
inline bool isManaged() const { return true; }
- void *exceptionHandler() { return m_allocation->exceptionHandler(); }
- void *start() { return m_allocation->start(); }
- size_t sizeInBytes() { return m_size; }
+ void *memoryStart() { return m_allocation->memoryStart(); }
+ size_t memorySize() { return m_allocation->memorySize(); }
+
+ void *exceptionHandlerStart() { return m_allocation->exceptionHandlerStart(); }
+ size_t exceptionHandlerSize() { return m_allocation->exceptionHandlerSize(); }
+
+ void *codeStart() { return m_allocation->codeStart(); }
+ size_t codeSize() { return m_size; }
QV4::ExecutableAllocator::ChunkOfPages *chunk() const
{ return m_allocator->chunkForAllocation(m_allocation); }
diff --git a/src/qml/jsruntime/qv4executableallocator.cpp b/src/qml/jsruntime/qv4executableallocator.cpp
index 7ee6f39aa2..c06773d3c5 100644
--- a/src/qml/jsruntime/qv4executableallocator.cpp
+++ b/src/qml/jsruntime/qv4executableallocator.cpp
@@ -45,12 +45,22 @@
using namespace QV4;
-void *ExecutableAllocator::Allocation::exceptionHandler() const
+void *ExecutableAllocator::Allocation::exceptionHandlerStart() const
{
return reinterpret_cast<void*>(addr);
}
-void *ExecutableAllocator::Allocation::start() const
+size_t ExecutableAllocator::Allocation::exceptionHandlerSize() const
+{
+ return QV4::exceptionHandlerSize();
+}
+
+void *ExecutableAllocator::Allocation::memoryStart() const
+{
+ return reinterpret_cast<void*>(addr);
+}
+
+void *ExecutableAllocator::Allocation::codeStart() const
{
return reinterpret_cast<void*>(addr + exceptionHandlerSize());
}
diff --git a/src/qml/jsruntime/qv4executableallocator_p.h b/src/qml/jsruntime/qv4executableallocator_p.h
index f98f2c7d33..4735fb151f 100644
--- a/src/qml/jsruntime/qv4executableallocator_p.h
+++ b/src/qml/jsruntime/qv4executableallocator_p.h
@@ -86,8 +86,14 @@ public:
, free(true)
{}
- void *exceptionHandler() const;
- void *start() const;
+ void *memoryStart() const;
+ size_t memorySize() const { return size; }
+
+ void *exceptionHandlerStart() const;
+ size_t exceptionHandlerSize() const;
+
+ void *codeStart() const;
+
void invalidate() { addr = 0; }
bool isValid() const { return addr != 0; }
void deallocate(ExecutableAllocator *allocator);
diff --git a/src/qml/jsruntime/qv4functiontable_win64.cpp b/src/qml/jsruntime/qv4functiontable_win64.cpp
index fc13dc2602..0cb98641cd 100644
--- a/src/qml/jsruntime/qv4functiontable_win64.cpp
+++ b/src/qml/jsruntime/qv4functiontable_win64.cpp
@@ -106,7 +106,7 @@ struct ExceptionHandlerRecord
void generateFunctionTable(Function *, JSC::MacroAssemblerCodeRef *codeRef)
{
ExceptionHandlerRecord *record = reinterpret_cast<ExceptionHandlerRecord *>(
- codeRef->executableMemory()->exceptionHandler());
+ codeRef->executableMemory()->exceptionHandlerStart());
record->info.Version = 1;
record->info.Flags = 0;
@@ -136,7 +136,7 @@ void generateFunctionTable(Function *, JSC::MacroAssemblerCodeRef *codeRef)
void destroyFunctionTable(Function *, JSC::MacroAssemblerCodeRef *codeRef)
{
ExceptionHandlerRecord *record = reinterpret_cast<ExceptionHandlerRecord *>(
- codeRef->executableMemory()->exceptionHandler());
+ codeRef->executableMemory()->exceptionHandlerStart());
if (!RtlDeleteFunctionTable(&record->handler)) {
const unsigned int errorCode = GetLastError();
qWarning() << "Failed to remove win64 unwind hook. Error code:" << errorCode;
--
2.31.1

View File

@ -0,0 +1,81 @@
From 688795f02ecc163e7cb18dfb6c87273d7e613cbf 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
parent
Items are visible if they are children of a visible parent, and not
explicitly hidden. The effectiveVisible member stores the state and is
updated when conditions that impact the item visibility changes.
The old code returned true for items outside a visual hierarchy, which
broke signal emission when items were removed from a parent, e.g.
because the parent got destroyed. With this change, items removed from
a visual hierarchy will emit the visibleChanged signal.
Note: QQuickItem initializes the effectiveVisible member to true, even
if the item was created without parent item. Visual items are required
to be added to a visual hierarchy via setParentItem. For this reason,
newly created items never emit visibleChanged when they are added to
a parent.
Adjust the QQuickItem::visible test - it creates an item hierarchy
without window. Such items are never visible, so add a window and
parent the test item hierarchy to the window's content item.
This fixes the expected failures in the tests. It does introduce an
incompatibility with QGraphicsView and QGraphicsItem, which continue
to return true from QGraphicsItem::isVisible for items that are not
in an item hierarchy.
[ChangeLog][Qt Quick][QQuickItem] The visible property of Items without
a parent now always returns false, and the visibleChanged signal gets
emitted when the parent item of a visible item becomes null.
Fixes: QTBUG-108213
Change-Id: If4b2947cefd1407853f0f29e6c3fdbd49fc9af65
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit d1b9a4cacfb966cf0a37983d8f8044f3aedf5de3)
CCBUG: 467909
CCBUG: 396359
---
src/quick/items/qquickitem.cpp | 6 ++----
tests/auto/quick/qquickitem/tst_qquickitem.cpp | 2 ++
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index c370d6e5c3..0d421349d7 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -6081,10 +6081,8 @@ void QQuickItem::setEnabled(bool e)
bool QQuickItemPrivate::calcEffectiveVisible() const
{
- // XXX todo - Should the effective visible of an element with no parent just be the current
- // effective visible? This would prevent pointless re-processing in the case of an element
- // moving to/from a no-parent situation, but it is different from what graphics view does.
- return explicitVisible && (!parentItem || QQuickItemPrivate::get(parentItem)->effectiveVisible);
+ // An item is visible if it is a child of a visible parent, and not explicitly hidden.
+ return explicitVisible && parentItem && QQuickItemPrivate::get(parentItem)->effectiveVisible;
}
bool QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible)
diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
index 42348d8dd1..34eefd85e6 100644
--- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
@@ -989,7 +989,9 @@ void tst_qquickitem::setParentItem()
void tst_qquickitem::visible()
{
+ QQuickWindow window;
QQuickItem *root = new QQuickItem;
+ root->setParentItem(window.contentItem());
QQuickItem *child1 = new QQuickItem;
child1->setParentItem(root);
--
2.40.1

View File

@ -0,0 +1,51 @@
From 70bc0c03423fe861bb917c67041f71e08ec10343 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
without parent"
This breaks applications that use QQmlPropertyList to store QQuickItem
and don't set a parentItem for them.
Ref: https://github.com/musescore/MuseScore/issues/17276
This reverts commit 45c22a0221937682f4496801a495458a00f76d3a.
---
src/quick/items/qquickitem.cpp | 6 ++++--
tests/auto/quick/qquickitem/tst_qquickitem.cpp | 2 --
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 0d421349d7..c370d6e5c3 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -6081,8 +6081,10 @@ void QQuickItem::setEnabled(bool e)
bool QQuickItemPrivate::calcEffectiveVisible() const
{
- // An item is visible if it is a child of a visible parent, and not explicitly hidden.
- return explicitVisible && parentItem && QQuickItemPrivate::get(parentItem)->effectiveVisible;
+ // XXX todo - Should the effective visible of an element with no parent just be the current
+ // effective visible? This would prevent pointless re-processing in the case of an element
+ // moving to/from a no-parent situation, but it is different from what graphics view does.
+ return explicitVisible && (!parentItem || QQuickItemPrivate::get(parentItem)->effectiveVisible);
}
bool QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible)
diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
index 34eefd85e6..42348d8dd1 100644
--- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
@@ -989,9 +989,7 @@ void tst_qquickitem::setParentItem()
void tst_qquickitem::visible()
{
- QQuickWindow window;
QQuickItem *root = new QQuickItem;
- root->setParentItem(window.contentItem());
QQuickItem *child1 = new QQuickItem;
child1->setParentItem(root);
--
2.40.1

View File

@ -1,103 +0,0 @@
From e203a185cfab199a89a33b903096d6d0023a8a88 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@qt.io>
Date: Wed, 30 Sep 2020 13:51:59 +0200
Subject: [PATCH 24/28] doc: explain QQItem event delivery, handlers,
setAcceptTouchEvents()
We quietly recommended calling setAcceptTouchEvents() in the Qt 5.10
release notes in any Item subclass that wants to receive touch events,
and in the docs for setAcceptTouchEvents() itself; but the message about
the impending behavior change might not have been obvious enough.
In Qt 6 it becomes mandatory, so clearer docs will hopefully help to
stave off bogus bug reports.
We also never had a great overview of event handling from an Item's
perspective; now it's a little better.
Followup to ab91e7fa02a562d80fd0747f28a60e00c3b45a01 and
a97759a336c597327cb82eebc9f45c793aec32c9
[ChangeLog][QtQuick][QQuickItem] When subclassing QQuickItem, you
should call setAcceptTouchEvents(true) if you need the item to receive
touch events. It will be required in Qt 6.
Task-number: QTBUG-87018
Task-number: QTBUG-87082
Change-Id: I1c7a43979e3665778d61949c9d37c1d085ed594b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7c648280bb53c4276ba4ae2abf26d070fedde71a)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
src/quick/items/qquickitem.cpp | 34 +++++++++++++++++++++++++++++-----
1 file changed, 29 insertions(+), 5 deletions(-)
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index ddd67522b9..e02df00595 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtQuick module of the Qt Toolkit.
+** This file is part of the QtQuick module of the Qt Toolkit.fset
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -1883,7 +1883,23 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus)
\endqml
- \section2 Key Handling
+ \section2 Event Handling
+
+ All Item-based visual types can use \l {Qt Quick Input Handlers}{Input Handlers}
+ to handle incoming input events (subclasses of QInputEvent), such as mouse,
+ touch and key events. This is the preferred declarative way to handle events.
+
+ An alternative way to handle touch events is to subclass QQuickItem, call
+ setAcceptTouchEvents() in the constructor, and override touchEvent().
+ \l {QEvent::setAccepted()}{Accept} the entire event to stop delivery to
+ items underneath, and to exclusively grab all the event's touch points.
+
+ Likewise, a QQuickItem subclass can call setAcceptedMouseButtons()
+ to register to receive mouse button events, setAcceptHoverEvents()
+ to receive hover events (mouse movements while no button is pressed),
+ and override the virtual functions mousePressEvent(), mouseMoveEvent(), and
+ mouseReleaseEvent(). Those can also accept the event to prevent further
+ delivery and get an implicit grab at the same time.
Key handling is available to all Item-based visual types via the \l Keys
attached property. The \e Keys attached property provides basic signals
@@ -7301,7 +7317,9 @@ bool QQuickItem::isAncestorOf(const QQuickItem *child) const
If an item does not accept the mouse button for a particular mouse event,
the mouse event will not be delivered to the item and will be delivered
to the next item in the item hierarchy instead.
- */
+
+ \sa acceptTouchEvents()
+*/
Qt::MouseButtons QQuickItem::acceptedMouseButtons() const
{
Q_D(const QQuickItem);
@@ -7310,7 +7328,13 @@ Qt::MouseButtons QQuickItem::acceptedMouseButtons() const
/*!
Sets the mouse buttons accepted by this item to \a buttons.
- */
+
+ \note In Qt 5, calling setAcceptedMouseButtons() implicitly caused
+ an item to receive touch events as well as mouse events; but it was
+ recommended to call setAcceptTouchEvents() to subscribe for them.
+ In Qt 6, it is necessary to call setAcceptTouchEvents() to continue
+ to receive them.
+*/
void QQuickItem::setAcceptedMouseButtons(Qt::MouseButtons buttons)
{
Q_D(QQuickItem);
--
2.31.1

View File

@ -0,0 +1,111 @@
From a9f99d945e23b915502ddbd56e20a2af9f33296e 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
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/quick/accessible/qaccessiblequickitem.cpp | 2 +-
src/quick/items/qquickitem.cpp | 17 ++++++++++++-----
src/quick/items/qquickitem_p.h | 3 +++
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/quick/accessible/qaccessiblequickitem.cpp b/src/quick/accessible/qaccessiblequickitem.cpp
index a8df58d450..99e6eff7c3 100644
--- a/src/quick/accessible/qaccessiblequickitem.cpp
+++ b/src/quick/accessible/qaccessiblequickitem.cpp
@@ -230,7 +230,7 @@ QAccessible::Role QAccessibleQuickItem::role() const
QAccessible::Role role = QAccessible::NoRole;
if (item())
- role = QQuickItemPrivate::get(item())->accessibleRole();
+ role = QQuickItemPrivate::get(item())->effectiveAccessibleRole();
if (role == QAccessible::NoRole) {
if (qobject_cast<QQuickText*>(const_cast<QQuickItem *>(item())))
role = QAccessible::StaticText;
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index c370d6e5c3..9e8b289376 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -2400,7 +2400,7 @@ bool QQuickItemPrivate::canAcceptTabFocus(QQuickItem *item)
return true;
#if QT_CONFIG(accessibility)
- QAccessible::Role role = QQuickItemPrivate::get(item)->accessibleRole();
+ QAccessible::Role role = QQuickItemPrivate::get(item)->effectiveAccessibleRole();
if (role == QAccessible::EditableText || role == QAccessible::Table || role == QAccessible::List) {
return true;
} else if (role == QAccessible::ComboBox || role == QAccessible::SpinBox) {
@@ -9000,13 +9000,20 @@ QQuickItemPrivate::ExtraData::ExtraData()
#if QT_CONFIG(accessibility)
-QAccessible::Role QQuickItemPrivate::accessibleRole() const
+QAccessible::Role QQuickItemPrivate::effectiveAccessibleRole() const
{
Q_Q(const QQuickItem);
- QQuickAccessibleAttached *accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(qmlAttachedPropertiesObject<QQuickAccessibleAttached>(q, false));
- if (accessibleAttached)
- return accessibleAttached->role();
+ auto *attached = qmlAttachedPropertiesObject<QQuickAccessibleAttached>(q, 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 QQuickItemPrivate::accessibleRole() const
+{
return QAccessible::NoRole;
}
#endif
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h
index ade8fb61f2..6f329bd119 100644
--- a/src/quick/items/qquickitem_p.h
+++ b/src/quick/items/qquickitem_p.h
@@ -575,7 +575,10 @@ public:
virtual void implicitHeightChanged();
#if QT_CONFIG(accessibility)
+ QAccessible::Role effectiveAccessibleRole() const;
+private:
virtual QAccessible::Role accessibleRole() const;
+public:
#endif
void setImplicitAntialiasing(bool antialiasing);
--
2.40.1

View File

@ -1,39 +0,0 @@
From 6d7dfed857ab9e83ab2a917a929ce3b25342d90a Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <albert.astals.cid@kdab.com>
Date: Fri, 21 May 2021 13:30:41 +0200
Subject: [PATCH 25/28] Give a warning when StyledText encounters a non
supported entity
Pick-to: 6.1 5.15
Change-Id: Iea8bdf25542cd404ee71141467ac1f1398a7d0df
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 8cd43e370040e23fcbd03ad64969e683055bd7d0)
---
src/quick/util/qquickstyledtext.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/quick/util/qquickstyledtext.cpp b/src/quick/util/qquickstyledtext.cpp
index 660852ba83..d531fc9205 100644
--- a/src/quick/util/qquickstyledtext.cpp
+++ b/src/quick/util/qquickstyledtext.cpp
@@ -46,6 +46,8 @@
#include "qquickstyledtext_p.h"
#include <QQmlContext>
+Q_LOGGING_CATEGORY(lcStyledText, "qt.quick.styledtext")
+
/*
QQuickStyledText supports few tags:
@@ -566,6 +568,8 @@ void QQuickStyledTextPrivate::parseEntity(const QChar *&ch, const QString &textI
textOut += QChar(34);
else if (entity == QLatin1String("nbsp"))
textOut += QChar(QChar::Nbsp);
+ else
+ qCWarning(lcStyledText) << "StyledText doesn't support entity" << entity;
return;
} else if (*ch == QLatin1Char(' ')) {
QStringRef entity(&textIn, entityStart - 1, entityLength + 1);
--
2.31.1

View File

@ -1,33 +0,0 @@
From 4f08a2da5b0da675cf6a75683a43a106f5a1e7b8 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Sun, 23 May 2021 14:32:46 +0200
Subject: [PATCH 26/28] Add missing limits include to fix build with GCC 11
This is not required for Qt 6, since it is indirectly pulled via
qanystrigview.h, but it is for Qt 5 (where qanystrigview does
not exist) and, in any case, it is good to declare all used headers
and not rely on them being implicitly pulled.
Pick-to: 6.1 5.15
Change-Id: I97606ea493e723006759608b7d4c4f00632f340c
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
(cherry picked from commit 367293b18ab0d0a0432c1c8ce445fee052e5eee5)
---
src/qmldebug/qqmlprofilerevent_p.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qmldebug/qqmlprofilerevent_p.h b/src/qmldebug/qqmlprofilerevent_p.h
index a7e37d1964..01b2f58f16 100644
--- a/src/qmldebug/qqmlprofilerevent_p.h
+++ b/src/qmldebug/qqmlprofilerevent_p.h
@@ -48,6 +48,7 @@
#include <QtCore/qmetatype.h>
#include <initializer_list>
+#include <limits>
#include <type_traits>
//
--
2.31.1

View File

@ -0,0 +1,57 @@
From 5352f113b3c7a5af2ad2741d593c6e6a758eb93e 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
parse()
This handles the --version, --help and --help-all options.
Apparently there's no other way to handle --help-all, because
addHelpOption() adds two options but only returns one of them.
Amends bb6602bca2b20d98f24320b10c7a039e605c9a05
Fixes: QTBUG-100678
Pick-to: 6.2 6.5 5.15
Change-Id: Iddd1ba2dae975d7256935d8d357e2f3ac6c013d6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit e5007fcc43af6751c72ec970eed11df5fdb8638e)
* asturmlechner 2023-05-18: Resolve conflict with dev branch commit
a15472716dbef63f1e5ad27ee412c2a2408b44e2
---
tools/qml/main.cpp | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index beeec88f07..2cb7653d65 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -446,8 +446,8 @@ int main(int argc, char *argv[])
QCommandLineParser parser;
parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
parser.setOptionsAfterPositionalArgumentsMode(QCommandLineParser::ParseAsPositionalArguments);
- const QCommandLineOption helpOption = parser.addHelpOption();
- const QCommandLineOption versionOption = parser.addVersionOption();
+ parser.addHelpOption();
+ parser.addVersionOption();
#ifdef QT_GUI_LIB
QCommandLineOption apptypeOption(QStringList() << QStringLiteral("a") << QStringLiteral("apptype"),
QCoreApplication::translate("main", "Select which application class to use. Default is gui."),
@@ -522,14 +522,7 @@ int main(int argc, char *argv[])
parser.addPositionalArgument("args",
QCoreApplication::translate("main", "Arguments after '--' are ignored, but passed through to the application.arguments variable in QML."), "[-- args...]");
- if (!parser.parse(QCoreApplication::arguments())) {
- qWarning() << parser.errorText();
- exit(1);
- }
- if (parser.isSet(versionOption))
- parser.showVersion();
- if (parser.isSet(helpOption))
- parser.showHelp();
+ parser.process(*app);
if (parser.isSet(listConfOption))
listConfFiles();
if (applicationType == QmlApplicationTypeUnknown) {
--
2.40.1

View File

@ -1,29 +0,0 @@
From ebc0daeea59af400601e6207cd9939c746fccdc7 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <albert.astals.cid@kdab.com>
Date: Fri, 21 May 2021 13:17:15 +0200
Subject: [PATCH 27/28] Document that StyledText also supports &nbsp; and
&quot;
Change-Id: I1715f8ae8ec8d0fbaf6dbe2b8663cc169da663cd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 5848c081c094a66e024493fc1e5c2569e06f73b6)
---
src/quick/items/qquicktext.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 581ab9f76a..26840b99e3 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -2168,7 +2168,7 @@ void QQuickText::resetMaximumLineCount()
<img src="" align="top,middle,bottom" width="" height=""> - inline images
<ol type="">, <ul type=""> and <li> - ordered and unordered lists
<pre></pre> - preformatted
- &gt; &lt; &amp;
+ &gt; &lt; &amp; &quot; &nbsp;
\endcode
\c Text.StyledText parser is strict, requiring tags to be correctly nested.
--
2.31.1

View File

@ -1,44 +0,0 @@
From 0dda47d9f1a22567ad8f1266be2f0cd8a9226c7f Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <albert.astals.cid@kdab.com>
Date: Fri, 21 May 2021 13:42:35 +0200
Subject: [PATCH 28/28] Support &apos; in styled text
Pick-to: 6.1 5.15
Change-Id: I4a8db963e52a7899ab1796f9a560e8029cc1c929
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 96b528efcba1226d2980828d1255160bdceae4cf)
---
src/quick/items/qquicktext.cpp | 2 +-
src/quick/util/qquickstyledtext.cpp | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 26840b99e3..4ddd2a41bc 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -2168,7 +2168,7 @@ void QQuickText::resetMaximumLineCount()
<img src="" align="top,middle,bottom" width="" height=""> - inline images
<ol type="">, <ul type=""> and <li> - ordered and unordered lists
<pre></pre> - preformatted
- &gt; &lt; &amp; &quot; &nbsp;
+ &gt; &lt; &amp; &quot; &nbsp; &apos;
\endcode
\c Text.StyledText parser is strict, requiring tags to be correctly nested.
diff --git a/src/quick/util/qquickstyledtext.cpp b/src/quick/util/qquickstyledtext.cpp
index d531fc9205..a25af90414 100644
--- a/src/quick/util/qquickstyledtext.cpp
+++ b/src/quick/util/qquickstyledtext.cpp
@@ -564,6 +564,8 @@ void QQuickStyledTextPrivate::parseEntity(const QChar *&ch, const QString &textI
textOut += QChar(60);
else if (entity == QLatin1String("amp"))
textOut += QChar(38);
+ else if (entity == QLatin1String("apos"))
+ textOut += QChar(39);
else if (entity == QLatin1String("quot"))
textOut += QChar(34);
else if (entity == QLatin1String("nbsp"))
--
2.31.1

View File

@ -0,0 +1,44 @@
From e2bdde18d9758efdc6a0d7d106aad56995df1271 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
We cannot assume anything about the accumulator register after calling
PushCallContext::call(). Also add a note about not needing to re-load
the accumulator on ThrowException.
Pick-to: 6.5 6.2 5.15
Fixes: QTBUG-111935
Change-Id: I7196585e1d2697c215f4fe87d8d7ac9b98b622a3
---
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
--- a/src/qml/jit/qv4baselinejit.cpp
+++ b/src/qml/jit/qv4baselinejit.cpp
@@ -506,6 +506,8 @@ void BaselineJIT::generate_ThrowException()
as->passEngineAsArg(0);
BASELINEJIT_GENERATE_RUNTIME_CALL(ThrowException, CallResultDestination::Ignore);
as->gotoCatchException();
+
+ // LOAD_ACC(); <- not needed here since it would be unreachable.
}
void BaselineJIT::generate_GetException() { as->getException(); }
@@ -513,9 +515,11 @@ void BaselineJIT::generate_SetException() { as->setException(); }
void BaselineJIT::generate_CreateCallContext()
{
+ STORE_ACC();
as->prepareCallWithArgCount(1);
as->passCppFrameAsArg(0);
BASELINEJIT_GENERATE_RUNTIME_CALL(PushCallContext, CallResultDestination::Ignore);
+ LOAD_ACC();
}
void BaselineJIT::generate_PushCatchContext(int index, int name) { as->pushCatchContext(index, name); }
--
2.39.2

View File

@ -1,66 +1,100 @@
%global __provides_exclude_from ^%{_qt5_archdatadir}/qml/.*\\.so$
%define _lto_cflags %{nil}
%global qt_module qtdeclarative
%global multilib_archs x86_64 %{ix86} %{?mips} ppc64 ppc s390x s390 sparc64 sparcv9
Name: qt5-qtdeclarative
Version: 5.15.2
Release: 2
License: LGPLv2 with exceptions or GPLv3 with exceptions
Summary: Qt5 module for declarative framework
Name: qt5-%{qt_module}
Version: 5.15.10
Release: 1
Summary: Qt5 - QtDeclarative component
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/qtdeclarative-everywhere-src-%{version}.tar.xz
Source1: qv4global_p-multilib.h
Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submodules/%{qt_module}-everywhere-opensource-src-%{version}.tar.xz
Source5: qv4global_p-multilib.h
Patch1: 0005-QQuickView-docs-show-correct-usage-of-setInitialProp.patch
Patch2: 0006-QQuickWindow-Check-if-QQuickItem-was-not-deleted.patch
Patch3: 0007-Avoid-GHS-linker-to-optimize-away-QML-type-registrat.patch
Patch4: 0008-QML-Text-doesn-t-reset-lineCount-when-text-is-empty.patch
Patch5: 0009-Doc-mention-that-INCLUDEPATH-must-be-set-in-some-cas.patch
Patch6: 0010-qmlfunctions.qdoc-Add-clarification-to-QML_FOREIGN.patch
Patch7: 0011-Fix-QML-property-cache-leaks-of-delegate-items.patch
Patch8: 0012-QQuickTextInput-Store-mask-data-in-std-unique_ptr.patch
Patch9: 0013-Fix-crash-when-calling-hasOwnProperty-on-proxy-objec.patch
Patch10: 0014-Accessibility-event-is-sent-on-item-s-geometry-chang.patch
Patch11: 0015-qmltypes.prf-Take-abi-into-account-for-_metatypes.js.patch
Patch12: 0016-qv4qmlcontext-Fix-bounded-signal-expressions-when-de.patch
Patch13: 0017-Use-load-qt_tool-for-qmltime.patch
Patch14: 0018-qqmlistmodel-Fix-crash-when-modelCache-is-null.patch
Patch15: 0019-Show-a-tableview-even-if-the-syncView-has-an-empty-m.patch
Patch16: 0020-DesignerSupport-Don-t-skip-already-inspected-objects.patch
Patch17: 0021-QML-Fix-proxy-iteration.patch
Patch18: 0022-Fix-IC-properties-in-same-file.patch
Patch19: 0023-JIT-When-making-memory-writable-include-the-exceptio.patch
Patch20: 0024-doc-explain-QQItem-event-delivery-handlers-setAccept.patch
Patch21: 0025-Give-a-warning-when-StyledText-encounters-a-non-supp.patch
Patch22: 0026-Add-missing-limits-include-to-fix-build-with-GCC-11.patch
Patch23: 0027-Document-that-StyledText-also-supports-nbsp-and-quot.patch
Patch24: 0028-Support-apos-in-styled-text.patch
Patch25: %{name}-gcc11.patch
Patch26: qtdeclarative-5.15.0-FixMaxXMaxYExtent.patch
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
Obsoletes: qt5-qtjsbackend < 5.2.0 qt5-qtdeclarative-render2d < 5.7.1-10
BuildRequires: make
BuildRequires: gcc-c++ qt5-rpm-macros >= %{version} qt5-qtbase-devel >= %{version}
BuildRequires: qt5-qtbase-private-devel python%{python3_pkgversion}
%{?_qt5:Requires: %{_qt5} = %{_qt5_version}}
Patch100: %{name}-gcc11.patch
Patch101: qtdeclarative-5.15.0-FixMaxXMaxYExtent.patch
Patch102: qt-QTBUG-111935-fix-V4-jit.patch
# filter qml provides
Obsoletes: qt5-qtjsbackend < 5.2.0
Obsoletes: qt5-qtdeclarative-render2d < 5.7.1-10
BuildRequires: make
BuildRequires: gcc-c++
BuildRequires: qt5-rpm-macros
BuildRequires: qt5-qtbase-devel >= %{version}
BuildRequires: qt5-qtbase-private-devel
%{?_qt5:Requires: %{_qt5}%{?_isa} = %{_qt5_version}}
BuildRequires: python%{python3_pkgversion}
%if 0%{?bootstrap}
Obsoletes: %{name}-examples < %{version}-%{release}
%global no_examples CONFIG-=compile_examples
%endif
%if 0%{?tests}
BuildRequires: dbus-x11 mesa-dri-drivers time xorg-x11-server-Xvfb
BuildRequires: dbus-x11
BuildRequires: mesa-dri-drivers
BuildRequires: time
BuildRequires: xorg-x11-server-Xvfb
%endif
%description
This package contains base tools, like string, xml, and network handling.
%{summary}.
%package devel
Summary: Library and header files of %{name}
Requires: %{name} = %{version}-%{release} qt5-qtbase-devel
Provides: %{name}-private-devel = %{version}-%{release}
Provides: %{name}-static = %{version}-%{release} %{name}-examples = %{version}-%{release}
Obsoletes: qt5-qtjsbackend-devel < 5.2.0 qt5-qtdeclarative-render2d-devel < 5.7.1-10
Obsoletes: %{name}-static < %{version}-%{release} %{name}-examples < %{version}-%{release}
Summary: Development files for %{name}
Obsoletes: qt5-qtjsbackend-devel < 5.2.0
Obsoletes: qt5-qtdeclarative-render2d-devel < 5.7.1-10
Provides: %{name}-private-devel = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: qt5-qtbase-devel%{?_isa}
%description devel
%{name}-devel provides libraries and header files for %{name}.
%{summary}.
%package static
Summary: Static library files for %{name}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description static
%{summary}.
%package examples
Summary: Programming examples for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description examples
%{summary}.
%prep
%autosetup -n qtdeclarative-everywhere-src-%{version} -p1
@ -77,60 +111,69 @@ export PATH=`pwd`:$PATH
%install
%make_install INSTALL_ROOT=%{buildroot}
%ifarch x86_64
pushd %{buildroot}%{_qt5_headerdir}/QtQml/%{version}/QtQml/private
mv qv4global_p.h qv4global_p-%{__isa_bits}.h
popd
install -p -m644 -D %{SOURCE1} %{buildroot}%{_qt5_headerdir}/QtQml/%{version}/QtQml/private/qv4global_p.h
%ifarch %{multilib_archs}
# multilib: qv4global_p.h
mv %{buildroot}%{_qt5_headerdir}/QtQml/%{version}/QtQml/private/qv4global_p.h \
%{buildroot}%{_qt5_headerdir}/QtQml/%{version}/QtQml/private/qv4global_p-%{__isa_bits}.h
install -p -m644 -D %{SOURCE5} %{buildroot}%{_qt5_headerdir}/QtQml/%{version}/QtQml/private/qv4global_p.h
%endif
install -d %{buildroot}%{_bindir}
# hardlink files to %{_bindir}, add -qt5 postfix to not conflict
mkdir %{buildroot}%{_bindir}
pushd %{buildroot}%{_qt5_bindir}
for file in * ; do
case "${file}" in
for i in * ; do
case "${i}" in
# qt4 conflicts
qmlplugindump|qmlprofiler)
ln -v ${file} %{buildroot}%{_bindir}/${file}-qt5
ln -sv ${file} ${file}-qt5
ln -v ${i} %{buildroot}%{_bindir}/${i}-qt5
ln -sv ${i} ${i}-qt5
;;
qml|qmlbundle|qmlmin|qmlscene)
ln -v ${file} %{buildroot}%{_bindir}/${file}
ln -v ${file} %{buildroot}%{_bindir}/${file}-qt5
ln -sv ${file} ${file}-qt5
ln -v ${i} %{buildroot}%{_bindir}/${i}
ln -v ${i} %{buildroot}%{_bindir}/${i}-qt5
ln -sv ${i} ${i}-qt5
;;
*)
ln -v ${file} %{buildroot}%{_bindir}/${file}
ln -v ${i} %{buildroot}%{_bindir}/${i}
;;
esac
done
popd
pushd %{buildroot}%{_qt5_libdir}
for file in libQt5*.prl ; do
sed -i -e "/^QMAKE_PRL_BUILD_DIR/d" ${file}
rm -fv "$(basename ${file} .prl).la"
sed -i -e "/^QMAKE_PRL_LIBS/d" ${file}
for prl_file in libQt5*.prl ; do
sed -i -e "/^QMAKE_PRL_BUILD_DIR/d" ${prl_file}
rm -fv "$(basename ${prl_file} .prl).la"
sed -i -e "/^QMAKE_PRL_LIBS/d" ${prl_file}
done
popd
%check
%if 0%{?tests}
export CTEST_OUTPUT_ON_FAILURE=1
export PATH=%{buildroot}%{_qt5_bindir}:$PATH
export LD_LIBRARY_PATH=%{buildroot}%{_qt5_libdir}
export CTEST_OUTPUT_ON_FAILURE=1 PATH=%{buildroot}%{_qt5_bindir}:$PATH
make sub-tests-all %{?_smp_mflags}
xvfb-run -a dbus-launch --exit-with-session time \
xvfb-run -a \
dbus-launch --exit-with-session \
time \
make check -k -C tests ||:
%endif
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%ldconfig_scriptlets
%files
%license LICENSE.LGPL*
%{_qt5_libdir}/libQt5Qml.so.5*
%{_qt5_libdir}/libQt5Quick*.so.5*
%{_qt5_libdir}/libQt5QmlModels.so.5*
%{_qt5_libdir}/libQt5QmlWorkerScript.so.5*
%{_qt5_libdir}/libQt5Quick.so.5*
%{_qt5_libdir}/libQt5QuickWidgets.so.5*
%{_qt5_libdir}/libQt5QuickParticles.so.5*
%{_qt5_libdir}/libQt5QuickShapes.so.5*
%{_qt5_libdir}/libQt5QuickTest.so.5*
%{_qt5_plugindir}/qmltooling/
%{_qt5_archdatadir}/qml/
@ -138,20 +181,42 @@ make check -k -C tests ||:
%{_bindir}/qml*
%{_qt5_bindir}/qml*
%{_qt5_headerdir}/Qt*/
%{_qt5_libdir}/pkgconfig/Qt5*.pc
%{_qt5_libdir}/libQt5Qml*.{a,so,prl}
%{_qt5_libdir}/libQt5Quick*.{so,prl}
%{_qt5_libdir}/libQt5Qml.so
%{_qt5_libdir}/libQt5Qml.prl
%{_qt5_libdir}/libQt5QmlModels.so
%{_qt5_libdir}/libQt5QmlModels.prl
%{_qt5_libdir}/libQt5QmlWorkerScript.so
%{_qt5_libdir}/libQt5QmlWorkerScript.prl
%{_qt5_libdir}/libQt5Quick*.so
%{_qt5_libdir}/libQt5Quick*.prl
%dir %{_qt5_libdir}/cmake/Qt5Quick*/
%{_qt5_libdir}/cmake/Qt5*/Qt5*Config*.cmake
%{_qt5_libdir}/libQt5PacketProtocol.{a,prl}
%{_qt5_libdir}/metatypes/qt5*_metatypes.json
%{_qt5_libdir}/pkgconfig/Qt5*.pc
%{_qt5_archdatadir}/mkspecs/modules/*.pri
%{_qt5_archdatadir}/mkspecs/features/*.prf
%dir %{_qt5_libdir}/cmake/Qt5Qml/
%{_qt5_libdir}/cmake/Qt5Qml/Qt5Qml_*Factory.cmake
%{_qt5_archdatadir}/mkspecs/{modules/*.pri,features/*.prf}
%{_qt5_libdir}/cmake/Qt5QmlImportScanner/
%dir %{_qt5_libdir}/cmake/{Qt5Qml/,Qt5Quick*/}
%files static
%{_qt5_libdir}/libQt5QmlDevTools.a
%{_qt5_libdir}/libQt5QmlDevTools.prl
%{_qt5_libdir}/libQt5PacketProtocol.a
%{_qt5_libdir}/libQt5PacketProtocol.prl
%{_qt5_libdir}/libQt5QmlDebug.a
%{_qt5_libdir}/libQt5QmlDebug.prl
%if ! 0%{?no_examples:1}
%files examples
%{_qt5_examplesdir}/
%endif
%changelog
* Mon Aug 21 2023 huayadong <huayadong@kylinos.cn> - 5.15.10-1
- update to version 5.15.10-1
* Fri Jan 7 2022 peijiankang <peijiankang@kylinos.cn> - 5.15.2-2
- rm qt5-qtdeclarative-5.15.2-7.eln112.src.rpm

View File

@ -21,18 +21,18 @@ tests.
Fixes: QTBUG-83890
Pick-to: 5.15
Change-Id: I7f4060c2f46ae07611bedceca0d322c5f7f6affb
========================================================================================================================
Index: qtdeclarative-everywhere-src-5.15.2/src/quick/items/qquickitemview.cpp
===================================================================
--- qtdeclarative-everywhere-src-5.15.2.orig/src/quick/items/qquickitemview.cpp
+++ qtdeclarative-everywhere-src-5.15.2/src/quick/items/qquickitemview.cpp
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp
index 2b4ca9e2..f2feba2a 100644
--- a/src/quick/items/qquickitemview.cpp
+++ b/src/quick/items/qquickitemview.cpp
@@ -1393,7 +1393,7 @@ qreal QQuickItemView::maxYExtent() const
{
Q_D(const QQuickItemView);
if (d->layoutOrientation() == Qt::Horizontal)
- return height();
+ return QQuickFlickable::maxYExtent();
if (d->vData.maxExtentDirty) {
d->maxExtent = d->maxExtentForAxis(d->vData, false);
@@ -1421,7 +1421,7 @@ qreal QQuickItemView::maxXExtent() const
@ -41,304 +41,6 @@ Index: qtdeclarative-everywhere-src-5.15.2/src/quick/items/qquickitemview.cpp
if (d->layoutOrientation() == Qt::Vertical)
- return width();
+ return QQuickFlickable::maxXExtent();
if (d->hData.maxExtentDirty) {
d->maxExtent = d->maxExtentForAxis(d->hData, true);
Index: qtdeclarative-everywhere-src-5.15.2/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
===================================================================
--- qtdeclarative-everywhere-src-5.15.2.orig/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ qtdeclarative-everywhere-src-5.15.2/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -73,6 +73,8 @@ public:
tst_QQuickListView();
private slots:
+ // WARNING: please add new tests to tst_qquicklistview2; this file is too slow to work with.
+
void init();
void cleanupTestCase();
// Test QAbstractItemModel model types
@@ -299,6 +301,8 @@ private slots:
void requiredObjectListModel();
void clickHeaderAndFooterWhenClip();
+ // WARNING: please add new tests to tst_qquicklistview2; this file is too slow to work with.
+
private:
template <class T> void items(const QUrl &source);
template <class T> void changed(const QUrl &source);
@@ -10094,6 +10098,8 @@ void tst_QQuickListView::clickHeaderAndF
QVERIFY(root->property("footerPressed").toBool());
}
+// WARNING: please add new tests to tst_qquicklistview2; this file is too slow to work with.
+
QTEST_MAIN(tst_QQuickListView)
#include "tst_qquicklistview.moc"
Index: qtdeclarative-everywhere-src-5.15.2/tests/auto/quick/qquicklistview2/data/maxXExtent.qml
===================================================================
--- /dev/null
+++ qtdeclarative-everywhere-src-5.15.2/tests/auto/quick/qquicklistview2/data/maxXExtent.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+
+Item {
+ property alias view: view
+
+ ListView {
+ id: view
+ model: 10
+ width: 200
+ height: 200
+
+ Rectangle {
+ anchors.fill: parent
+ color: "transparent"
+ border.color: "darkorange"
+ }
+
+ delegate: Rectangle {
+ width: 100
+ height: 100
+ Text {
+ text: modelData
+ }
+ }
+ }
+}
Index: qtdeclarative-everywhere-src-5.15.2/tests/auto/quick/qquicklistview2/data/maxYExtent.qml
===================================================================
--- /dev/null
+++ qtdeclarative-everywhere-src-5.15.2/tests/auto/quick/qquicklistview2/data/maxYExtent.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+
+Item {
+ property alias view: view
+
+ ListView {
+ id: view
+ model: 10
+ width: 200
+ height: 200
+ orientation: ListView.Horizontal
+
+ Rectangle {
+ anchors.fill: parent
+ color: "transparent"
+ border.color: "darkorange"
+ }
+
+ delegate: Rectangle {
+ width: 100
+ height: 100
+ Text {
+ text: modelData
+ }
+ }
+ }
+}
Index: qtdeclarative-everywhere-src-5.15.2/tests/auto/quick/qquicklistview2/qquicklistview2.pro
===================================================================
--- /dev/null
+++ qtdeclarative-everywhere-src-5.15.2/tests/auto/quick/qquicklistview2/qquicklistview2.pro
@@ -0,0 +1,12 @@
+CONFIG += testcase
+TARGET = tst_qquicklistview2
+macos:CONFIG -= app_bundle
+
+SOURCES += tst_qquicklistview2.cpp
+
+include (../../shared/util.pri)
+include (../shared/util.pri)
+
+TESTDATA = data/*
+
+QT += core-private gui-private qml-private quick-private testlib qmltest
Index: qtdeclarative-everywhere-src-5.15.2/tests/auto/quick/qquicklistview2/tst_qquicklistview2.cpp
===================================================================
--- /dev/null
+++ qtdeclarative-everywhere-src-5.15.2/tests/auto/quick/qquicklistview2/tst_qquicklistview2.cpp
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtQuickTest/QtQuickTest>
+#include <QtQml/qqmlapplicationengine.h>
+#include <QtQuick/qquickview.h>
+#include <QtQuick/private/qquicklistview_p.h>
+
+#include "../../shared/util.h"
+#include "../shared/viewtestutil.h"
+
+using namespace QQuickViewTestUtil;
+
+class tst_QQuickListView2 : public QQmlDataTest
+{
+ Q_OBJECT
+
+public:
+ tst_QQuickListView2();
+
+private slots:
+ void maxExtent_data();
+ void maxExtent();
+};
+
+tst_QQuickListView2::tst_QQuickListView2()
+{
+}
+
+class FriendlyItemView : public QQuickItemView
+{
+ friend class ItemViewAccessor;
+};
+
+class ItemViewAccessor
+{
+public:
+ ItemViewAccessor(QQuickItemView *itemView) :
+ mItemView(reinterpret_cast<FriendlyItemView*>(itemView))
+ {
+ }
+
+ qreal maxXExtent() const
+ {
+ return mItemView->maxXExtent();
+ }
+
+ qreal maxYExtent() const
+ {
+ return mItemView->maxYExtent();
+ }
+
+private:
+ FriendlyItemView *mItemView = nullptr;
+};
+
+void tst_QQuickListView2::maxExtent_data()
+{
+ QTest::addColumn<QString>("qmlFilePath");
+
+ QTest::addRow("maxXExtent") << "maxXExtent.qml";
+ QTest::addRow("maxYExtent") << "maxYExtent.qml";
+}
+
+void tst_QQuickListView2::maxExtent()
+{
+ QFETCH(QString, qmlFilePath);
+
+ QScopedPointer<QQuickView> window(createView());
+ QVERIFY(window);
+ window->setSource(testFileUrl(qmlFilePath));
+ QVERIFY2(window->status() == QQuickView::Ready, qPrintable(QDebug::toString(window->errors())));
+ window->resize(640, 480);
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
+
+ QQuickListView *view = window->rootObject()->property("view").value<QQuickListView*>();
+ QVERIFY(view);
+ ItemViewAccessor viewAccessor(view);
+ if (view->orientation() == QQuickListView::Vertical)
+ QCOMPARE(viewAccessor.maxXExtent(), 0);
+ else if (view->orientation() == QQuickListView::Horizontal)
+ QCOMPARE(viewAccessor.maxYExtent(), 0);
+}
+
+QTEST_MAIN(tst_QQuickListView2)
+
+#include "tst_qquicklistview2.moc"
Index: qtdeclarative-everywhere-src-5.15.2/tests/auto/quick/quick.pro
===================================================================
--- qtdeclarative-everywhere-src-5.15.2.orig/tests/auto/quick/quick.pro
+++ qtdeclarative-everywhere-src-5.15.2/tests/auto/quick/quick.pro
@@ -67,6 +67,7 @@ QUICKTESTS += \
qquickitem2 \
qquickitemlayer \
qquicklistview \
+ qquicklistview2 \
qquicktableview \
qquickloader \
qquickmousearea \