Merge remote-tracking branch 'origin/3.7' into 3.8
This commit is contained in:
commit
cb88115428
@ -99,6 +99,7 @@ drwxr-xr-x root/root usr/include/node/libplatform/
|
||||
-rw-r--r-- root/root usr/include/node/v8-promise.h
|
||||
-rw-r--r-- root/root usr/include/node/v8-proxy.h
|
||||
-rw-r--r-- root/root usr/include/node/v8-regexp.h
|
||||
-rw-r--r-- root/root usr/include/node/v8-sandbox.h
|
||||
-rw-r--r-- root/root usr/include/node/v8-script.h
|
||||
-rw-r--r-- root/root usr/include/node/v8-snapshot.h
|
||||
-rw-r--r-- root/root usr/include/node/v8-source-location.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
untrusted comment: verify with /etc/ports/opt.pub
|
||||
RWSE3ohX2g5d/dMZ3bD1E8V/gkS/uQXBjndz7WcQhMOfV9Yoa+CV0+UqYjfuJzfY3MnCt2CF8tFAu+le4WLKHDCSgkIyMFkj7Qo=
|
||||
SHA256 (Pkgfile) = 2d22839d19a672e072d28486abd2141aff656e8d62e0fc977f8798398819fc01
|
||||
SHA256 (.footprint) = 3150c1e8bc4bec5c9d351873b44bba9bf9f6c91e9e29b8871ee27e3bf18b3a70
|
||||
SHA256 (node-v22.11.0.tar.xz) = bbf0297761d53aefda9d7855c57c7d2c272b83a7b5bad4fea9cb29006d8e1d35
|
||||
RWSE3ohX2g5d/bFKh7saBxigWcKyeKMEqB0jsI0MbmApVsfe+TuI5kcysTwb4tipZWw5L9fquHHoeLivxiT0Fh1q1KuopfCJwwI=
|
||||
SHA256 (Pkgfile) = 68f5c9fe766e878c7559e170d759e493a247a097f43a3022d6cd9f46ebc25470
|
||||
SHA256 (.footprint) = def23a3729301dfd00b0facca8cd0509d93d42520eef6f841a018cfb874da59f
|
||||
SHA256 (node-v23.1.0.tar.xz) = 57cbfd3dd51f9300ea2b8e60a8ed215b1eaa71fbde4c3903a7d31a443a4a4423
|
||||
SHA256 (system-c-ares.patch) = 1ab0f849fe4fae2d295b6c60c12825d5f2c29f5b28b721916d1b550704b0f5f3
|
||||
|
@ -5,7 +5,7 @@
|
||||
# Optional: brotli c-ares icu
|
||||
|
||||
name=nodejs
|
||||
version=22.11.0
|
||||
version=23.1.0
|
||||
release=1
|
||||
source=(https://nodejs.org/dist/v$version/node-v$version.tar.xz
|
||||
system-c-ares.patch)
|
||||
|
@ -1,5 +1,5 @@
|
||||
untrusted comment: verify with /etc/ports/opt.pub
|
||||
RWSE3ohX2g5d/fLDIz+veI190JenIf37TITbFLHGmjbeg2RwkYSAAHn+UFQEjWjkc8ECLAnecDT/Ms+SYuxhmjEOCreUYwfSfgI=
|
||||
SHA256 (Pkgfile) = cfac5d9cb73914d5ffaf1cefda7eb9c11221c37f4de113f78a69215acb826612
|
||||
untrusted comment: verify with /etc/ports/core.pub
|
||||
RWRJc1FUaeVeqjMaBqcW18DTYF7Ljn6+1Lduk8fEvofS4Mg/xAlQIIU/evClNxP6n529tebDfeBBpqpbBc4OhXekIvDkpKD60As=
|
||||
SHA256 (Pkgfile) = 6f54fcd24f1efb29d7abb97c8a3617216a6a15a078a4d4c5cedc3762f909d5de
|
||||
SHA256 (.footprint) = bf2aed50126b38391372c03278e24d75487df41df2f00d6e14d7d73f8cc910c4
|
||||
SHA256 (cython-3.0.11.tar.gz) = 7146dd2af8682b4ca61331851e6aebce9fe5158e75300343f80c07ca80b1faff
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Description: C extensions for Python
|
||||
# URL: https://www.cython.org/
|
||||
# URL: https://cython.org/
|
||||
# Maintainer: Tim Biermann, tbier at posteo dot de
|
||||
# Depends on: python3-build python3-installer python3-wheel
|
||||
|
||||
|
@ -2,16 +2,16 @@ drwxr-xr-x root/root usr/
|
||||
drwxr-xr-x root/root usr/lib/
|
||||
drwxr-xr-x root/root usr/lib/python3.12/
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/packaging-24.1.dist-info/
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.1.dist-info/INSTALLER
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.1.dist-info/LICENSE
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.1.dist-info/LICENSE.APACHE
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.1.dist-info/LICENSE.BSD
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.1.dist-info/METADATA
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.1.dist-info/RECORD
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.1.dist-info/REQUESTED (EMPTY)
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.1.dist-info/WHEEL
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.1.dist-info/direct_url.json
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/packaging-24.2.dist-info/
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.2.dist-info/INSTALLER
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.2.dist-info/LICENSE
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.2.dist-info/LICENSE.APACHE
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.2.dist-info/LICENSE.BSD
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.2.dist-info/METADATA
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.2.dist-info/RECORD
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.2.dist-info/REQUESTED (EMPTY)
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.2.dist-info/WHEEL
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging-24.2.dist-info/direct_url.json
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/packaging/
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging/__init__.py
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/packaging/__pycache__/
|
||||
@ -35,6 +35,12 @@ drwxr-xr-x root/root usr/lib/python3.12/site-packages/packaging/__pycache__/
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging/_parser.py
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging/_structures.py
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging/_tokenizer.py
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/packaging/licenses/
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging/licenses/__init__.py
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/packaging/licenses/__pycache__/
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging/licenses/__pycache__/__init__.cpython-312.pyc
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging/licenses/__pycache__/_spdx.cpython-312.pyc
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging/licenses/_spdx.py
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging/markers.py
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging/metadata.py
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/packaging/py.typed (EMPTY)
|
||||
|
@ -1,5 +1,5 @@
|
||||
untrusted comment: verify with /etc/ports/opt.pub
|
||||
RWSE3ohX2g5d/YtH+2zkbHdxVSu2Daeo/zbJxuwxudqILnRmo/N0ntIizTSeRffR4uxvkz1FNsVEvVfPFL9a3t0sgHar0nhiLQM=
|
||||
SHA256 (Pkgfile) = c30d28e3e39501b2d21eeeca996d6199f9803949aa38efb97118a1b80ae39c9d
|
||||
SHA256 (.footprint) = 57cee5ef6251361eb0b047efc504b7f642e5a84459389ff426b5df7760944ebe
|
||||
SHA256 (packaging-24.1.tar.gz) = 026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002
|
||||
untrusted comment: verify with /etc/ports/core.pub
|
||||
RWRJc1FUaeVeqk4dcO9Bxzk4Jv2TV+mZpmKIBcG+WPKIGyBmuQmlHG5R4FVRpTppOMtA24zSUUo3qRuls0qKBzXSapUIJYlnfwA=
|
||||
SHA256 (Pkgfile) = 867caad496c0a77fea40afd93227842f113bda2d94a5e045dcf85cf14206d45c
|
||||
SHA256 (.footprint) = ed436d5d7851018fe5e02da1dc74dbd96b5feb9373e3a3bb14a7bc0bb09bd639
|
||||
SHA256 (packaging-24.2.tar.gz) = c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Depends on: python3-flit-core
|
||||
|
||||
name=python3-packaging
|
||||
version=24.1
|
||||
version=24.2
|
||||
release=1
|
||||
source=(https://pypi.org/packages/source/p/packaging/packaging-$version.tar.gz)
|
||||
|
||||
|
@ -4,13 +4,13 @@ drwxr-xr-x root/root usr/bin/
|
||||
drwxr-xr-x root/root usr/lib/
|
||||
drwxr-xr-x root/root usr/lib/python3.12/
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/wheel-0.44.0-py3.12.egg-info/
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel-0.44.0-py3.12.egg-info/PKG-INFO
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel-0.44.0-py3.12.egg-info/SOURCES.txt
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel-0.44.0-py3.12.egg-info/dependency_links.txt
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel-0.44.0-py3.12.egg-info/entry_points.txt
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel-0.44.0-py3.12.egg-info/requires.txt
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel-0.44.0-py3.12.egg-info/top_level.txt
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/wheel-0.45.0-py3.12.egg-info/
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel-0.45.0-py3.12.egg-info/PKG-INFO
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel-0.45.0-py3.12.egg-info/SOURCES.txt
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel-0.45.0-py3.12.egg-info/dependency_links.txt
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel-0.45.0-py3.12.egg-info/entry_points.txt
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel-0.45.0-py3.12.egg-info/requires.txt
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel-0.45.0-py3.12.egg-info/top_level.txt
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/wheel/
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel/__init__.py
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel/__main__.py
|
||||
@ -62,6 +62,9 @@ drwxr-xr-x root/root usr/lib/python3.12/site-packages/wheel/vendored/__pycache__
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel/vendored/__pycache__/__init__.cpython-312.opt-1.pyc
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel/vendored/__pycache__/__init__.cpython-312.pyc
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/wheel/vendored/packaging/
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel/vendored/packaging/LICENSE
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel/vendored/packaging/LICENSE.APACHE
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel/vendored/packaging/LICENSE.BSD
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel/vendored/packaging/__init__.py (EMPTY)
|
||||
drwxr-xr-x root/root usr/lib/python3.12/site-packages/wheel/vendored/packaging/__pycache__/
|
||||
-rw-r--r-- root/root usr/lib/python3.12/site-packages/wheel/vendored/packaging/__pycache__/__init__.cpython-312.opt-1.pyc
|
||||
|
@ -1,5 +1,5 @@
|
||||
untrusted comment: verify with /etc/ports/opt.pub
|
||||
RWSE3ohX2g5d/Wk7YisxCNhsQAfzARrwgisPpmUEmrb42m23ma9r5eQhkxljEdClW83ZMBq1u2p16NoPa2z1ekmrYiM7kLjs+Qw=
|
||||
SHA256 (Pkgfile) = e18313198d1dabbb9b6916138e1aae5438808b02cbab6dde766b6736c8b96e2b
|
||||
SHA256 (.footprint) = c28a7ec41e2a1acf5c1fb8e9ace88ec299d08e1eee3b8f68daa494a783091ac4
|
||||
SHA256 (wheel-0.44.0.tar.gz) = a29c3f2817e95ab89aa4660681ad547c0e9547f20e75b0562fe7723c9a2a9d49
|
||||
untrusted comment: verify with /etc/ports/core.pub
|
||||
RWRJc1FUaeVeqtLX4iuouPxKE5riiIGOYi8ddG2r85RsT8uI+gMoQuaMlw/tlcECOEcrzIL4SpuB5YqZCYvyIK0HVz6WBFLzjgU=
|
||||
SHA256 (Pkgfile) = 2e56d41f0cf3347f87d9b7cc57edf5c38ad46cbc249dbd0cfc3b3f2c11c20515
|
||||
SHA256 (.footprint) = 43e7135d628fc51cc1465b7056676f28db8b2e863f08ad9a669cfac7813f7c49
|
||||
SHA256 (wheel-0.45.0.tar.gz) = a57353941a3183b3d5365346b567a260a0602a0f8a635926a7dede41b94c674a
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Depends on: python3-setuptools
|
||||
|
||||
name=python3-wheel
|
||||
version=0.44.0
|
||||
version=0.45.0
|
||||
release=1
|
||||
source=(https://files.pythonhosted.org/packages/source/w/wheel/${name#*-}-$version.tar.gz)
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
untrusted comment: verify with /etc/ports/opt.pub
|
||||
RWSE3ohX2g5d/QJFNETGtxi8j3hnMMTwPZnUoMUKVzxoIm0FJWHm5/aBRyVGpozQX5ancqfGCVrcd9aW11FYHoeliSfgalRlNw8=
|
||||
SHA256 (Pkgfile) = 8f010396f351b1120c8f4e3c55066c015c85815f936acdfe22506957f68470a1
|
||||
RWSE3ohX2g5d/f7neiWrfVrYc9M7ftCqz3MEbsyq7SdPQAx3daMf9R8tb2sTt4HQUcR3ghLS+atV4jX1phr0mDtQZ0EwGVng0gA=
|
||||
SHA256 (Pkgfile) = 0687509244546ed4e82e61d437f81356f7ae6119afa62d8deb988267348c0715
|
||||
SHA256 (.footprint) = 37c308d9ff921f9b95cdafd76b735c0325883c79b7b36d000ab2081c49bd04f5
|
||||
SHA256 (qtdeclarative-everywhere-src-6.8.0.tar.xz) = 3b41a36b42e919a3aa0da1f71107591504200f41707bee2ad8e8d4f99b5644c2
|
||||
SHA256 (0ae3697cf40bcd3ae1de20621abad17cf6c5f52d.patch) = 120eb09ec7d9c5b743a73f97bb30820ddccc8873221df8d14d77547e700b1e08
|
||||
SHA256 (861a7921ed7833a90f77b5fca436c789a4f9517c.patch) = 9e066087da5f50bc4e007bf900376485eda7ef029e80045a7f1faec745e9c171
|
||||
SHA256 (281f620ceea03e7a222d796ae0cca917a9778368.patch) = 7c87386230443299c178e5b6fa27615cbbb68b014a480502a879dc85e0747c60
|
||||
|
125
qt6-declarative/0ae3697cf40bcd3ae1de20621abad17cf6c5f52d.patch
Normal file
125
qt6-declarative/0ae3697cf40bcd3ae1de20621abad17cf6c5f52d.patch
Normal file
@ -0,0 +1,125 @@
|
||||
From 0ae3697cf40bcd3ae1de20621abad17cf6c5f52d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= <tor.arne.vestbo@qt.io>
|
||||
Date: Wed, 2 Oct 2024 17:04:25 +0200
|
||||
Subject: QQuickItem::map{To,From}Item: Account for not having a window yet
|
||||
|
||||
Prior to 06ace3e226b2394362e27d1bc4743c1170777af1 we would not
|
||||
account for items in different scenes, and would map them as if
|
||||
they were part of the same scene.
|
||||
|
||||
After 06ace3e226b2394362e27d1bc4743c1170777af1 we took the scenes
|
||||
into account, but failed to guard against one or both of the items
|
||||
not having a scene (yet), causing potential crashes.
|
||||
|
||||
We now properly check that both items have a scene before trying
|
||||
any scene to scene mapping.
|
||||
|
||||
The semantics if one or both of the items are not in a scene is
|
||||
kept as it was before 06ace3e226b2394362e27d1bc4743c1170777af1,
|
||||
where we assume the two items are part of the same scene, and an
|
||||
item without a parent is assumed to be the root of its scene.
|
||||
|
||||
Fixes: QTBUG-129500
|
||||
Change-Id: I897faf73d04dddd68a7a8797e5238743efdd4f73
|
||||
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
||||
(cherry picked from commit 08b0e3e39e899bea013057a7ac038b8878809712)
|
||||
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
|
||||
---
|
||||
src/quick/items/qquickitem.cpp | 14 ++++++-----
|
||||
.../qquickitem2/data/mapCoordinatesWithWindows.qml | 11 +++++++++
|
||||
tests/auto/quick/qquickitem2/tst_qquickitem.cpp | 27 ++++++++++++++++++++++
|
||||
3 files changed, 46 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
|
||||
index 9288df17a4..802f4dad55 100644
|
||||
--- a/src/quick/items/qquickitem.cpp
|
||||
+++ b/src/quick/items/qquickitem.cpp
|
||||
@@ -8755,9 +8755,10 @@ QPointF QQuickItem::mapToItem(const QQuickItem *item, const QPointF &point) cons
|
||||
{
|
||||
QPointF p = mapToScene(point);
|
||||
if (item) {
|
||||
- const QQuickWindow *itemWindow = item->window();
|
||||
- if (itemWindow != nullptr && itemWindow != window())
|
||||
- p = itemWindow->mapFromGlobal(window()->mapToGlobal(p));
|
||||
+ const auto *itemWindow = item->window();
|
||||
+ const auto *thisWindow = window();
|
||||
+ if (thisWindow && itemWindow && itemWindow != thisWindow)
|
||||
+ p = itemWindow->mapFromGlobal(thisWindow->mapToGlobal(p));
|
||||
|
||||
p = item->mapFromScene(p);
|
||||
}
|
||||
@@ -8862,9 +8863,10 @@ QPointF QQuickItem::mapFromItem(const QQuickItem *item, const QPointF &point) co
|
||||
QPointF p = point;
|
||||
if (item) {
|
||||
p = item->mapToScene(point);
|
||||
-
|
||||
- if (item->window() != window())
|
||||
- p = window()->mapFromGlobal(item->window()->mapToGlobal(p));
|
||||
+ const auto *itemWindow = item->window();
|
||||
+ const auto *thisWindow = window();
|
||||
+ if (thisWindow && itemWindow && itemWindow != thisWindow)
|
||||
+ p = thisWindow->mapFromGlobal(itemWindow->mapToGlobal(p));
|
||||
}
|
||||
return mapFromScene(p);
|
||||
}
|
||||
diff --git a/tests/auto/quick/qquickitem2/data/mapCoordinatesWithWindows.qml b/tests/auto/quick/qquickitem2/data/mapCoordinatesWithWindows.qml
|
||||
index 98fc0e77af..1696699a75 100644
|
||||
--- a/tests/auto/quick/qquickitem2/data/mapCoordinatesWithWindows.qml
|
||||
+++ b/tests/auto/quick/qquickitem2/data/mapCoordinatesWithWindows.qml
|
||||
@@ -48,4 +48,15 @@ QtObject {
|
||||
color: "cyan"
|
||||
}
|
||||
}
|
||||
+
|
||||
+ property Item itemWithoutWindowA: Item {
|
||||
+ x: 20; y: 20
|
||||
+ }
|
||||
+ property Item itemWithoutWindowB: Item {
|
||||
+ x: 40; y: 40
|
||||
+ Item {
|
||||
+ objectName: "childItemWithoutWindow"
|
||||
+ x: 30; y: 30
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
|
||||
index 154c4a661f..eb4f62e65f 100644
|
||||
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
|
||||
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
|
||||
@@ -2945,6 +2945,33 @@ void tst_QQuickItem::mapCoordinatesWithWindows()
|
||||
globalItemOffset(childItemInChildWindow, childItemInOtherWindow));
|
||||
QCOMPARE(childItemInChildWindow->mapFromItem(childItemInOtherWindow, {0, 0}),
|
||||
globalItemOffset(childItemInOtherWindow, childItemInChildWindow));
|
||||
+
|
||||
+ // If one or both of the items are not in a scene (yet), they are assumed
|
||||
+ // to eventually be in the same scene.
|
||||
+
|
||||
+ auto *itemWithoutWindowA = root->property("itemWithoutWindowA").value<QQuickItem*>();
|
||||
+ QVERIFY(itemWithoutWindowA);
|
||||
+ auto *itemWithoutWindowB = root->property("itemWithoutWindowB").value<QQuickItem*>();
|
||||
+ QVERIFY(itemWithoutWindowB);
|
||||
+ auto *childItemWithoutWindow = itemWithoutWindowB->findChild<QQuickItem*>("childItemWithoutWindow");
|
||||
+ QVERIFY(childItemWithoutWindow);
|
||||
+
|
||||
+ QPoint itemWithoutWindowAPos = itemWithoutWindowA->position().toPoint();
|
||||
+ QPoint itemWithoutWindowBPos = itemWithoutWindowB->position().toPoint();
|
||||
+
|
||||
+ QCOMPARE(itemWithoutWindowA->mapToItem(childItemWithoutWindow, {0, 0}),
|
||||
+ itemWithoutWindowAPos - (itemWithoutWindowBPos + childItemWithoutWindow->position()));
|
||||
+ QCOMPARE(itemWithoutWindowA->mapFromItem(childItemWithoutWindow, {0, 0}),
|
||||
+ (itemWithoutWindowBPos + childItemWithoutWindow->position()) - itemWithoutWindowAPos);
|
||||
+
|
||||
+ QCOMPARE(itemWithoutWindowA->mapToItem(childItem, {0, 0}),
|
||||
+ itemWithoutWindowAPos - itemPos);
|
||||
+ QCOMPARE(itemWithoutWindowA->mapFromItem(childItem, {0, 0}),
|
||||
+ itemPos - itemWithoutWindowAPos);
|
||||
+ QCOMPARE(childItem->mapToItem(itemWithoutWindowA, {0, 0}),
|
||||
+ itemPos - itemWithoutWindowAPos);
|
||||
+ QCOMPARE(childItem->mapFromItem(itemWithoutWindowA, {0, 0}),
|
||||
+ itemWithoutWindowAPos - itemPos);
|
||||
}
|
||||
|
||||
void tst_QQuickItem::transforms_data()
|
||||
--
|
||||
cgit v1.2.3
|
||||
|
418
qt6-declarative/281f620ceea03e7a222d796ae0cca917a9778368.patch
Normal file
418
qt6-declarative/281f620ceea03e7a222d796ae0cca917a9778368.patch
Normal file
@ -0,0 +1,418 @@
|
||||
From 281f620ceea03e7a222d796ae0cca917a9778368 Mon Sep 17 00:00:00 2001
|
||||
From: Mitch Curtis <mitch.curtis@qt.io>
|
||||
Date: Tue, 24 Sep 2024 08:18:14 +0800
|
||||
Subject: Revert "QQmlDelegateModel: fix delegates not being created in certain
|
||||
cases"
|
||||
|
||||
This reverts commit 6561344dd2d1ba69abe6edec4fe340b256da9e13. It needs
|
||||
to be fixed in a different way.
|
||||
|
||||
Fixes: QTBUG-127340
|
||||
Pick-to: 6.5 6.7 6.8
|
||||
Change-Id: I8503b22a5257e0fb5ee11a1bdf83d3dcab4a600a
|
||||
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
||||
---
|
||||
src/qmlmodels/qqmldelegatemodel.cpp | 61 +++-------
|
||||
src/qmlmodels/qqmldelegatemodel_p_p.h | 2 -
|
||||
tests/auto/qml/qqmldelegatemodel/CMakeLists.txt | 1 -
|
||||
tests/auto/qml/qqmldelegatemodel/data/reset.qml | 28 -----
|
||||
.../data/resetInQAIMConstructor.qml | 28 -----
|
||||
.../qqmldelegatemodel/tst_qqmldelegatemodel.cpp | 135 ++-------------------
|
||||
6 files changed, 29 insertions(+), 226 deletions(-)
|
||||
delete mode 100644 tests/auto/qml/qqmldelegatemodel/data/reset.qml
|
||||
delete mode 100644 tests/auto/qml/qqmldelegatemodel/data/resetInQAIMConstructor.qml
|
||||
|
||||
diff --git a/src/qmlmodels/qqmldelegatemodel.cpp b/src/qmlmodels/qqmldelegatemodel.cpp
|
||||
index fdd55a9928..dce5f71326 100644
|
||||
--- a/src/qmlmodels/qqmldelegatemodel.cpp
|
||||
+++ b/src/qmlmodels/qqmldelegatemodel.cpp
|
||||
@@ -172,7 +172,6 @@ QQmlDelegateModelPrivate::QQmlDelegateModelPrivate(QQmlContext *ctxt)
|
||||
, m_transaction(false)
|
||||
, m_incubatorCleanupScheduled(false)
|
||||
, m_waitingToFetchMore(false)
|
||||
- , m_maybeResetRoleNames(false)
|
||||
, m_cacheItems(nullptr)
|
||||
, m_items(nullptr)
|
||||
, m_persistedItems(nullptr)
|
||||
@@ -366,7 +365,6 @@ void QQmlDelegateModelPrivate::connectToAbstractItemModel()
|
||||
QObject::connect(aim, &QAbstractItemModel::dataChanged, q, &QQmlDelegateModel::_q_dataChanged);
|
||||
QObject::connect(aim, &QAbstractItemModel::rowsMoved, q, &QQmlDelegateModel::_q_rowsMoved);
|
||||
QObject::connect(aim, &QAbstractItemModel::modelAboutToBeReset, q, &QQmlDelegateModel::_q_modelAboutToBeReset);
|
||||
- QObject::connect(aim, &QAbstractItemModel::modelReset, q, &QQmlDelegateModel::handleModelReset);
|
||||
QObject::connect(aim, &QAbstractItemModel::layoutChanged, q, &QQmlDelegateModel::_q_layoutChanged);
|
||||
}
|
||||
|
||||
@@ -387,7 +385,6 @@ void QQmlDelegateModelPrivate::disconnectFromAbstractItemModel()
|
||||
QObject::disconnect(aim, &QAbstractItemModel::dataChanged, q, &QQmlDelegateModel::_q_dataChanged);
|
||||
QObject::disconnect(aim, &QAbstractItemModel::rowsMoved, q, &QQmlDelegateModel::_q_rowsMoved);
|
||||
QObject::disconnect(aim, &QAbstractItemModel::modelAboutToBeReset, q, &QQmlDelegateModel::_q_modelAboutToBeReset);
|
||||
- QObject::disconnect(aim, &QAbstractItemModel::modelReset, q, &QQmlDelegateModel::handleModelReset);
|
||||
QObject::disconnect(aim, &QAbstractItemModel::layoutChanged, q, &QQmlDelegateModel::_q_layoutChanged);
|
||||
}
|
||||
|
||||
@@ -1905,28 +1902,25 @@ void QQmlDelegateModel::_q_modelAboutToBeReset()
|
||||
Q_D(QQmlDelegateModel);
|
||||
if (!d->m_adaptorModel.adaptsAim())
|
||||
return;
|
||||
-
|
||||
- /*
|
||||
- roleNames are generally guaranteed to be stable (given that QAIM has no
|
||||
- change signal for them), except that resetting the model is allowed to
|
||||
- invalidate them (QTBUG-32132). DelegateModel must take this into account by
|
||||
- snapshotting the current roleNames before the model is reset.
|
||||
- Afterwards, if we detect that roleNames has changed, we throw the
|
||||
- current model set up away and rebuild everything from scratch – it is
|
||||
- unlikely that a more efficient implementation would be worth it.
|
||||
-
|
||||
- If we detect no changes, we simply use the existing logic to handle the
|
||||
- model reset.
|
||||
-
|
||||
- This (role name resetting) logic relies on the fact that
|
||||
- modelAboutToBeReset must be followed by a modelReset signal before any
|
||||
- further modelAboutToBeReset can occur. However, it's possible for user
|
||||
- code to begin the reset before connectToAbstractItemModel is called
|
||||
- (QTBUG-125053), in which case we don't attempt to reset the role names.
|
||||
- */
|
||||
- Q_ASSERT(!d->m_maybeResetRoleNames);
|
||||
- d->m_maybeResetRoleNames = true;
|
||||
- d->m_roleNamesBeforeReset = d->m_adaptorModel.aim()->roleNames();
|
||||
+ auto aim = d->m_adaptorModel.aim();
|
||||
+ auto oldRoleNames = aim->roleNames();
|
||||
+ // this relies on the fact that modelAboutToBeReset must be followed
|
||||
+ // by a modelReset signal before any further modelAboutToBeReset can occur
|
||||
+ QObject::connect(aim, &QAbstractItemModel::modelReset, this, [this, d, oldRoleNames, aim](){
|
||||
+ if (!d->m_adaptorModel.adaptsAim() || d->m_adaptorModel.aim() != aim)
|
||||
+ return;
|
||||
+ if (oldRoleNames == aim->roleNames()) {
|
||||
+ // if the rolenames stayed the same (most common case), then we don't have
|
||||
+ // to throw away all the setup that we did
|
||||
+ handleModelReset();
|
||||
+ } else {
|
||||
+ // If they did change, we give up and just start from scratch via setMode
|
||||
+ setModel(QVariant::fromValue(model()));
|
||||
+ // but we still have to call handleModelReset, otherwise views will
|
||||
+ // not refresh
|
||||
+ handleModelReset();
|
||||
+ }
|
||||
+ }, Qt::SingleShotConnection);
|
||||
}
|
||||
|
||||
void QQmlDelegateModel::handleModelReset()
|
||||
@@ -1936,23 +1930,6 @@ void QQmlDelegateModel::handleModelReset()
|
||||
return;
|
||||
|
||||
int oldCount = d->m_count;
|
||||
-
|
||||
- if (d->m_maybeResetRoleNames) {
|
||||
- auto aim = d->m_adaptorModel.aim();
|
||||
- if (!d->m_adaptorModel.adaptsAim() || d->m_adaptorModel.aim() != aim)
|
||||
- return;
|
||||
-
|
||||
- // If the role names stayed the same (most common case), then we don't have
|
||||
- // to throw away all the setup that we did.
|
||||
- // If they did change, we give up and just start from scratch via setModel.
|
||||
- // We do this before handling the reset to ensure that views refresh.
|
||||
- if (aim->roleNames() != d->m_roleNamesBeforeReset)
|
||||
- setModel(QVariant::fromValue(model()));
|
||||
-
|
||||
- d->m_maybeResetRoleNames = false;
|
||||
- d->m_roleNamesBeforeReset.clear();
|
||||
- }
|
||||
-
|
||||
d->m_adaptorModel.rootIndex = QModelIndex();
|
||||
|
||||
if (d->m_complete) {
|
||||
diff --git a/src/qmlmodels/qqmldelegatemodel_p_p.h b/src/qmlmodels/qqmldelegatemodel_p_p.h
|
||||
index bae8fc8a23..3c7ab9281d 100644
|
||||
--- a/src/qmlmodels/qqmldelegatemodel_p_p.h
|
||||
+++ b/src/qmlmodels/qqmldelegatemodel_p_p.h
|
||||
@@ -334,7 +334,6 @@ public:
|
||||
QQmlReusableDelegateModelItemsPool m_reusableItemsPool;
|
||||
QList<QQDMIncubationTask *> m_finishedIncubating;
|
||||
QList<QByteArray> m_watchedRoles;
|
||||
- QHash<int, QByteArray> m_roleNamesBeforeReset;
|
||||
|
||||
QString m_filterGroup;
|
||||
|
||||
@@ -348,7 +347,6 @@ public:
|
||||
bool m_transaction : 1;
|
||||
bool m_incubatorCleanupScheduled : 1;
|
||||
bool m_waitingToFetchMore : 1;
|
||||
- bool m_maybeResetRoleNames : 1;
|
||||
|
||||
union {
|
||||
struct {
|
||||
diff --git a/tests/auto/qml/qqmldelegatemodel/CMakeLists.txt b/tests/auto/qml/qqmldelegatemodel/CMakeLists.txt
|
||||
index 966f5229df..8d8a90e0a7 100644
|
||||
--- a/tests/auto/qml/qqmldelegatemodel/CMakeLists.txt
|
||||
+++ b/tests/auto/qml/qqmldelegatemodel/CMakeLists.txt
|
||||
@@ -29,7 +29,6 @@ qt_internal_add_test(tst_qqmldelegatemodel
|
||||
Qt::QmlModelsPrivate
|
||||
Qt::QmlPrivate
|
||||
Qt::Quick
|
||||
- Qt::QuickPrivate
|
||||
Qt::QuickTestUtilsPrivate
|
||||
TESTDATA ${test_data}
|
||||
)
|
||||
diff --git a/tests/auto/qml/qqmldelegatemodel/data/reset.qml b/tests/auto/qml/qqmldelegatemodel/data/reset.qml
|
||||
deleted file mode 100644
|
||||
index 0fcd5e8afa..0000000000
|
||||
--- a/tests/auto/qml/qqmldelegatemodel/data/reset.qml
|
||||
+++ /dev/null
|
||||
@@ -1,28 +0,0 @@
|
||||
-import QtQuick
|
||||
-import Test
|
||||
-
|
||||
-Window {
|
||||
- id: root
|
||||
- width: 200
|
||||
- height: 200
|
||||
-
|
||||
- property alias listView: listView
|
||||
-
|
||||
- ResettableModel {
|
||||
- id: resetModel
|
||||
- }
|
||||
-
|
||||
- ListView {
|
||||
- id: listView
|
||||
- anchors.fill: parent
|
||||
- model: resetModel
|
||||
-
|
||||
- delegate: Rectangle {
|
||||
- implicitWidth: 100
|
||||
- implicitHeight: 50
|
||||
- color: "olivedrab"
|
||||
-
|
||||
- required property string display
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
diff --git a/tests/auto/qml/qqmldelegatemodel/data/resetInQAIMConstructor.qml b/tests/auto/qml/qqmldelegatemodel/data/resetInQAIMConstructor.qml
|
||||
deleted file mode 100644
|
||||
index cb1f226737..0000000000
|
||||
--- a/tests/auto/qml/qqmldelegatemodel/data/resetInQAIMConstructor.qml
|
||||
+++ /dev/null
|
||||
@@ -1,28 +0,0 @@
|
||||
-import QtQuick
|
||||
-import Test
|
||||
-
|
||||
-Window {
|
||||
- id: root
|
||||
- width: 200
|
||||
- height: 200
|
||||
-
|
||||
- property alias listView: listView
|
||||
-
|
||||
- ResetInConstructorModel {
|
||||
- id: resetInConstructorModel
|
||||
- }
|
||||
-
|
||||
- ListView {
|
||||
- id: listView
|
||||
- anchors.fill: parent
|
||||
- model: resetInConstructorModel
|
||||
-
|
||||
- delegate: Rectangle {
|
||||
- implicitWidth: 100
|
||||
- implicitHeight: 50
|
||||
- color: "olivedrab"
|
||||
-
|
||||
- required property string display
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
diff --git a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
|
||||
index d9f8b7aeba..2cacda5513 100644
|
||||
--- a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
|
||||
+++ b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <QtTest/qtest.h>
|
||||
#include <QtCore/qjsonobject.h>
|
||||
#include <QtCore/QConcatenateTablesProxyModel>
|
||||
-#include <QtCore/qtimer.h>
|
||||
#include <QtGui/QStandardItemModel>
|
||||
#include <QtQml/qqmlcomponent.h>
|
||||
#include <QtQml/qqmlapplicationengine.h>
|
||||
@@ -12,17 +11,11 @@
|
||||
#include <QtQmlModels/private/qqmllistmodel_p.h>
|
||||
#include <QtQuick/qquickview.h>
|
||||
#include <QtQuick/qquickitem.h>
|
||||
-#include <QtQuick/private/qquickitemview_p_p.h>
|
||||
-#include <QtQuick/private/qquicklistview_p.h>
|
||||
-#include <QtQuickTest/quicktest.h>
|
||||
#include <QtQuickTestUtils/private/qmlutils_p.h>
|
||||
-#include <QtQuickTestUtils/private/visualtestutils_p.h>
|
||||
#include <QtTest/QSignalSpy>
|
||||
|
||||
#include <forward_list>
|
||||
|
||||
-using namespace QQuickVisualTestUtils;
|
||||
-
|
||||
class tst_QQmlDelegateModel : public QQmlDataTest
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -32,8 +25,6 @@ public:
|
||||
|
||||
private slots:
|
||||
void resettingRolesRespected();
|
||||
- void resetInQAIMConstructor();
|
||||
- void reset();
|
||||
void valueWithoutCallingObjectFirst_data();
|
||||
void valueWithoutCallingObjectFirst();
|
||||
void qtbug_86017();
|
||||
@@ -53,9 +44,16 @@ private slots:
|
||||
void viewUpdatedOnDelegateChoiceAffectingRoleChange();
|
||||
};
|
||||
|
||||
-class BaseAbstractItemModel : public QAbstractItemModel
|
||||
+class AbstractItemModel : public QAbstractItemModel
|
||||
{
|
||||
+ Q_OBJECT
|
||||
public:
|
||||
+ AbstractItemModel()
|
||||
+ {
|
||||
+ for (int i = 0; i < 3; ++i)
|
||||
+ mValues.append(QString::fromLatin1("Item %1").arg(i));
|
||||
+ }
|
||||
+
|
||||
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override
|
||||
{
|
||||
if (parent.isValid())
|
||||
@@ -93,21 +91,10 @@ public:
|
||||
return mValues.at(index.row());
|
||||
}
|
||||
|
||||
-protected:
|
||||
+private:
|
||||
QVector<QString> mValues;
|
||||
};
|
||||
|
||||
-class AbstractItemModel : public BaseAbstractItemModel
|
||||
-{
|
||||
- Q_OBJECT
|
||||
-public:
|
||||
- AbstractItemModel()
|
||||
- {
|
||||
- for (int i = 0; i < 3; ++i)
|
||||
- mValues.append(QString::fromLatin1("Item %1").arg(i));
|
||||
- }
|
||||
-};
|
||||
-
|
||||
tst_QQmlDelegateModel::tst_QQmlDelegateModel()
|
||||
: QQmlDataTest(QT_QMLTEST_DATADIR)
|
||||
{
|
||||
@@ -166,109 +153,7 @@ void tst_QQmlDelegateModel::resettingRolesRespected()
|
||||
QObject *root = engine.rootObjects().constFirst();
|
||||
QVERIFY(!root->property("success").toBool());
|
||||
model->change();
|
||||
- QTRY_VERIFY_WITH_TIMEOUT(root->property("success").toBool(), 100);
|
||||
-}
|
||||
-
|
||||
-class ResetInConstructorModel : public BaseAbstractItemModel
|
||||
-{
|
||||
- Q_OBJECT
|
||||
- QML_ELEMENT
|
||||
-
|
||||
-public:
|
||||
- ResetInConstructorModel()
|
||||
- {
|
||||
- beginResetModel();
|
||||
- QTimer::singleShot(0, this, &ResetInConstructorModel::finishReset);
|
||||
- }
|
||||
-
|
||||
-private:
|
||||
- void finishReset()
|
||||
- {
|
||||
- mValues.append("First");
|
||||
- endResetModel();
|
||||
- }
|
||||
-};
|
||||
-
|
||||
-void tst_QQmlDelegateModel::resetInQAIMConstructor()
|
||||
-{
|
||||
- qmlRegisterTypesAndRevisions<ResetInConstructorModel>("Test", 1);
|
||||
-
|
||||
- QQuickApplicationHelper helper(this, "resetInQAIMConstructor.qml");
|
||||
- QVERIFY2(helper.ready, helper.failureMessage());
|
||||
- QQuickWindow *window = helper.window;
|
||||
- window->show();
|
||||
- QVERIFY(QTest::qWaitForWindowExposed(window));
|
||||
-
|
||||
- auto *listView = window->property("listView").value<QQuickListView *>();
|
||||
- QVERIFY(listView);
|
||||
- QTRY_VERIFY_WITH_TIMEOUT(listView->itemAtIndex(0), 100);
|
||||
- QQuickItem *firstDelegateItem = listView->itemAtIndex(0);
|
||||
- QVERIFY(firstDelegateItem);
|
||||
- QCOMPARE(firstDelegateItem->property("display").toString(), "First");
|
||||
-}
|
||||
-
|
||||
-class ResettableModel : public BaseAbstractItemModel
|
||||
-{
|
||||
- Q_OBJECT
|
||||
- QML_ELEMENT
|
||||
-
|
||||
-public:
|
||||
- ResettableModel()
|
||||
- {
|
||||
- mValues.append("First");
|
||||
- }
|
||||
-
|
||||
- void callBeginResetModel()
|
||||
- {
|
||||
- beginResetModel();
|
||||
- mValues.clear();
|
||||
- }
|
||||
-
|
||||
- void appendData()
|
||||
- {
|
||||
- mValues.append(QString::fromLatin1("Item %1").arg(mValues.size()));
|
||||
- }
|
||||
-
|
||||
- void callEndResetModel()
|
||||
- {
|
||||
- endResetModel();
|
||||
- }
|
||||
-};
|
||||
-
|
||||
-// Tests that everything works as expected when calling beginResetModel/endResetModel
|
||||
-// after the QAIM subclass constructor has run.
|
||||
-void tst_QQmlDelegateModel::reset()
|
||||
-{
|
||||
- qmlRegisterTypesAndRevisions<ResettableModel>("Test", 1);
|
||||
-
|
||||
- QQuickApplicationHelper helper(this, "reset.qml");
|
||||
- QVERIFY2(helper.ready, helper.failureMessage());
|
||||
- QQuickWindow *window = helper.window;
|
||||
- window->show();
|
||||
- QVERIFY(QTest::qWaitForWindowExposed(window));
|
||||
-
|
||||
- auto *listView = window->property("listView").value<QQuickListView *>();
|
||||
- QVERIFY(listView);
|
||||
- QQuickItem *firstDelegateItem = listView->itemAtIndex(0);
|
||||
- QVERIFY(firstDelegateItem);
|
||||
- QCOMPARE(firstDelegateItem->property("display").toString(), "First");
|
||||
-
|
||||
- const auto delegateModel = QQuickItemViewPrivate::get(listView)->model;
|
||||
- QSignalSpy rootIndexChangedSpy(delegateModel, SIGNAL(rootIndexChanged()));
|
||||
- QVERIFY(rootIndexChangedSpy.isValid());
|
||||
-
|
||||
- auto *model = listView->model().value<ResettableModel *>();
|
||||
- model->callBeginResetModel();
|
||||
- model->appendData();
|
||||
- model->callEndResetModel();
|
||||
- // This is verifies that handleModelReset isn't called
|
||||
- // more than once during this process, since it unconditionally emits rootIndexChanged.
|
||||
- QCOMPARE(rootIndexChangedSpy.count(), 1);
|
||||
-
|
||||
- QTRY_VERIFY_WITH_TIMEOUT(listView->itemAtIndex(0), 100);
|
||||
- firstDelegateItem = listView->itemAtIndex(0);
|
||||
- QVERIFY(firstDelegateItem);
|
||||
- QCOMPARE(firstDelegateItem->property("display").toString(), "Item 0");
|
||||
+ QTRY_VERIFY(root->property("success").toBool());
|
||||
}
|
||||
|
||||
void tst_QQmlDelegateModel::valueWithoutCallingObjectFirst_data()
|
||||
--
|
||||
cgit v1.2.3
|
||||
|
128
qt6-declarative/861a7921ed7833a90f77b5fca436c789a4f9517c.patch
Normal file
128
qt6-declarative/861a7921ed7833a90f77b5fca436c789a4f9517c.patch
Normal file
@ -0,0 +1,128 @@
|
||||
From 861a7921ed7833a90f77b5fca436c789a4f9517c Mon Sep 17 00:00:00 2001
|
||||
From: Mitch Curtis <mitch.curtis@qt.io>
|
||||
Date: Tue, 22 Oct 2024 13:26:08 +0800
|
||||
Subject: QQuickItemView: fix crash with zero-size SwipeView that uses Repeater
|
||||
|
||||
When running the minimal example from the bug report, the order of
|
||||
events is:
|
||||
|
||||
1. deletables are iterated in QQuickRepeater::clear(), and deleteLater
|
||||
is called on the delegate item.
|
||||
2. deletables are unparented. This causes Container (SwipeView) to be
|
||||
notified of the parent change and it removes the item. Part of this
|
||||
involves changing the currentIndex, since the removed item was current.
|
||||
3. SwipeView's contentItem (ListView) has its currentIndex bound to the
|
||||
container's, so QQuickItemView::setCurrentIndex is called.
|
||||
4. setCurrentIndex calls updateCurrent, which detects that the
|
||||
currentIndex (which is -1, because there was only one item) is out of
|
||||
range and so releases the item. This causes it to be added to
|
||||
unrequestedItems, even though it has been scheduled for deletion.
|
||||
|
||||
This patch makes QQuickItemView detect that the item is going to be
|
||||
deleted and not add it to the list of deletables.
|
||||
|
||||
Fixes: QTBUG-129622
|
||||
Pick-to: 6.5
|
||||
Change-Id: I999aedbdfafc61ff6d33eb6579331f470e9c1454
|
||||
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
||||
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
||||
(cherry picked from commit 18a6a658aaf25fa8c380daef8a72dee4c1661164)
|
||||
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
|
||||
---
|
||||
src/quick/items/qquickitemview.cpp | 4 +-
|
||||
.../quickcontrols/controls/data/tst_swipeview.qml | 59 ++++++++++++++++++++++
|
||||
2 files changed, 62 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp
|
||||
index 19e5b7f402..dabd5630db 100644
|
||||
--- a/src/quick/items/qquickitemview.cpp
|
||||
+++ b/src/quick/items/qquickitemview.cpp
|
||||
@@ -2499,7 +2499,9 @@ bool QQuickItemViewPrivate::releaseItem(FxViewItem *item, QQmlInstanceModel::Reu
|
||||
// One case where this can happen is moving an item out of one ObjectModel and into another.
|
||||
QQuickItemPrivate::get(item->item)->setCulled(true);
|
||||
}
|
||||
- if (!isClearing)
|
||||
+ // If deleteLater was called, the item isn't long for this world and so we shouldn't store references to it.
|
||||
+ // This can happen when a Repeater is used to populate items in SwipeView's ListView contentItem.
|
||||
+ if (!isClearing && !QObjectPrivate::get(item->item)->deleteLaterCalled)
|
||||
unrequestedItems.insert(item->item, model->indexOf(item->item, q));
|
||||
} else if (flags & QQmlInstanceModel::Destroyed) {
|
||||
item->item->setParentItem(nullptr);
|
||||
diff --git a/tests/auto/quickcontrols/controls/data/tst_swipeview.qml b/tests/auto/quickcontrols/controls/data/tst_swipeview.qml
|
||||
index 3a7558c0e4..a3dd16c304 100644
|
||||
--- a/tests/auto/quickcontrols/controls/data/tst_swipeview.qml
|
||||
+++ b/tests/auto/quickcontrols/controls/data/tst_swipeview.qml
|
||||
@@ -4,6 +4,7 @@
|
||||
import QtQuick
|
||||
import QtTest
|
||||
import QtQuick.Controls
|
||||
+import QtQuick.Layouts
|
||||
|
||||
TestCase {
|
||||
id: testCase
|
||||
@@ -760,4 +761,62 @@ TestCase {
|
||||
tryCompare(swipeListView, "contentX", swipeListView.width, 1000)
|
||||
compare(item2.x, swipeListView.width)
|
||||
}
|
||||
+
|
||||
+ Component {
|
||||
+ id: zeroSizeSwipeViewWithRepeatersComponent
|
||||
+
|
||||
+ Item {
|
||||
+ objectName: "rootItem"
|
||||
+ anchors.fill: parent
|
||||
+
|
||||
+ property alias swipeView: swipeView
|
||||
+ property int d
|
||||
+
|
||||
+ Timer {
|
||||
+ interval: 2
|
||||
+ running: true
|
||||
+ repeat: false
|
||||
+ onTriggered: d = 2
|
||||
+ }
|
||||
+
|
||||
+ SwipeView {
|
||||
+ id: swipeView
|
||||
+ contentItem.objectName: "swipeViewListView"
|
||||
+
|
||||
+ Repeater {
|
||||
+ objectName: "swipeViewContentItemRepeater"
|
||||
+ model: [
|
||||
+ {
|
||||
+ title: d
|
||||
+ }
|
||||
+ ]
|
||||
+
|
||||
+ delegate: GridLayout {
|
||||
+ objectName: "gridLayoutDelegate"
|
||||
+
|
||||
+ Repeater {
|
||||
+ id: repeater
|
||||
+ objectName: "delegateRepeater"
|
||||
+ model: d
|
||||
+ delegate: Item {
|
||||
+ objectName: "delegate" + index
|
||||
+
|
||||
+ required property int index
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // QTBUG-129622
|
||||
+ function test_zeroSizeSwipeViewWithRepeaters() {
|
||||
+ let root = createTemporaryObject(zeroSizeSwipeViewWithRepeatersComponent, testCase)
|
||||
+ verify(root)
|
||||
+
|
||||
+ let swipeView = root.swipeView
|
||||
+ tryCompare(root, "d", 2)
|
||||
+ // Shouldn't crash when the model is changed.
|
||||
+ }
|
||||
}
|
||||
--
|
||||
cgit v1.2.3
|
||||
|
@ -5,14 +5,21 @@
|
||||
|
||||
name=qt6-declarative
|
||||
version=6.8.0
|
||||
release=1
|
||||
source=(https://download.qt.io/official_releases/qt/${version%.*}/$version/submodules/qtdeclarative-everywhere-src-$version.tar.xz)
|
||||
release=2
|
||||
source=(https://download.qt.io/official_releases/qt/${version%.*}/$version/submodules/qtdeclarative-everywhere-src-$version.tar.xz
|
||||
0ae3697cf40bcd3ae1de20621abad17cf6c5f52d.patch
|
||||
861a7921ed7833a90f77b5fca436c789a4f9517c.patch
|
||||
281f620ceea03e7a222d796ae0cca917a9778368.patch
|
||||
)
|
||||
|
||||
build() {
|
||||
prt-get isinst ninja && PKGMK_QT6+=' -G Ninja'
|
||||
prt-get isinst ccache && PKGMK_QT6+=' -D QT_USE_CCACHE=ON' && PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"
|
||||
|
||||
cmake -S qtdeclarative-everywhere-src-$version -B build $PKGMK_QT6 \
|
||||
patch -Np1 -d qtdeclarative-everywhere-src-$version -i $SRC/0ae3697cf40bcd3ae1de20621abad17cf6c5f52d.patch
|
||||
patch -Np1 -d qtdeclarative-everywhere-src-$version -i $SRC/861a7921ed7833a90f77b5fca436c789a4f9517c.patch
|
||||
patch -Np1 -d qtdeclarative-everywhere-src-$version -i $SRC/281f620ceea03e7a222d796ae0cca917a9778368.patch
|
||||
|
||||
cmake -S qtdeclarative-everywhere-src-$version -B build -G Ninja $PKGMK_QT6 \
|
||||
-D INSTALL_PUBLICBINDIR=usr/bin \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
|
||||
|
@ -1,5 +1,5 @@
|
||||
untrusted comment: verify with /etc/ports/opt.pub
|
||||
RWSE3ohX2g5d/QMas++fxVr6WpRMcgR9YB2jvK9QQcIAUF09YNBGvOm4wo2yzDstFAOCq0gk9AZM4UHeeUFOYtiSGL/d6VzeBwY=
|
||||
SHA256 (Pkgfile) = 8bee55d4cc4e2e699749ab200792dfd2bc173676175d389629ec37f5371d9957
|
||||
RWSE3ohX2g5d/ezrETtnnH/b4zooYgu0CnMfHo8NttG1gr4511ufi/7oJGfVXgnqQSf9Yg51k1Tj/8fNoUJMVB7jCAodDszm0Qk=
|
||||
SHA256 (Pkgfile) = 37e07d65b6517f297208c93717c36c358bd1bbfd231e09afda4a7d66957a43c6
|
||||
SHA256 (.footprint) = 13391980e2f7dcd45eecf9913327905ab225d031482889c7024f17b7c86049f7
|
||||
SHA256 (tree-sitter-0.24.3-1.tar.gz) = 0a8d0cf8e09caba22ed0d8439f7fa1e3d8453800038e43ccad1f34ef29537da1
|
||||
SHA256 (tree-sitter-0.24.4-1.tar.gz) = d704832a6bfaac8b3cbca3b5d773cad613183ba8c04166638af2c6e5dfb9e2d2
|
||||
|
@ -5,7 +5,7 @@
|
||||
# Optional: nodejs
|
||||
|
||||
name=tree-sitter-cli
|
||||
version=0.24.3
|
||||
version=0.24.4
|
||||
release=1
|
||||
source=(https://github.com/tree-sitter/tree-sitter/archive/v$version/tree-sitter-$version-$release.tar.gz)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
untrusted comment: verify with /etc/ports/opt.pub
|
||||
RWSE3ohX2g5d/UVAwrR0A/ZZ79VO7PzNRM19JJ74ZcXrBt9CS5RrYkLGMdFoTZEDGJ9pIP2Zu2KJLp88jSBMmt9GkRwGXiijpAM=
|
||||
SHA256 (Pkgfile) = 2165c730dd34273de58fcae50125a113d67fe4d2f63ec05b6a903cdd385c1fa5
|
||||
RWSE3ohX2g5d/bON1EQhgF637l/fmQ/hGQqv5s3r5iNEshMA+PWKXg7iBnykigvbN8W2Kvi8tTDHFx6a36Dl4Q2yiFe5StiaTAU=
|
||||
SHA256 (Pkgfile) = dd611799ca66c642febe92ac6ac11437929bd8fe1c64f47cd415b1d08b853cb7
|
||||
SHA256 (.footprint) = 9e09e2b0e48cf3555bf709d3e2ab80a78e2bf1178ba9d36390f76054234e9c7a
|
||||
SHA256 (tree-sitter-0.24.3.tar.gz) = 0a8d0cf8e09caba22ed0d8439f7fa1e3d8453800038e43ccad1f34ef29537da1
|
||||
SHA256 (tree-sitter-0.24.4.tar.gz) = d704832a6bfaac8b3cbca3b5d773cad613183ba8c04166638af2c6e5dfb9e2d2
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Depends on:
|
||||
|
||||
name=tree-sitter
|
||||
version=0.24.3
|
||||
version=0.24.4
|
||||
release=1
|
||||
source=(https://github.com/tree-sitter/tree-sitter/archive/v$version/$name-$version.tar.gz)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user