Skip to Content.
Sympa Menu

sm-commit - [[SM-Commit] ] GIT changes to master grimoire by Treeve Jelbert (2f8767c639b14817e6eeb0b9bfa48d895b3fc253)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Treeve Jelbert <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
  • Subject: [[SM-Commit] ] GIT changes to master grimoire by Treeve Jelbert (2f8767c639b14817e6eeb0b9bfa48d895b3fc253)
  • Date: Sat, 12 Oct 2024 10:57:39 +0000

GIT changes to master grimoire by Treeve Jelbert <treeve AT sourcemage.org>:

ChangeLog | 3
FUNCTIONS | 2
devel/pyside6-tools/DETAILS | 17 +
devel/pyside6-tools/HISTORY | 6
devel/pyside6/DETAILS | 7
devel/pyside6/HISTORY | 3
devel/shiboken6/DETAILS | 6
devel/shiboken6/HISTORY | 3
doc/cmark/BUILD | 1
doc/cmark/CONFIGURE | 1
doc/cmark/DEPENDS | 1
doc/cmark/DETAILS | 5
doc/cmark/HISTORY | 5
python-pypi/firebird-driver/DETAILS | 6
python-pypi/firebird-driver/HISTORY | 3
python-pypi/pyparsing/DETAILS | 4
python-pypi/pyparsing/HISTORY | 3
python-pypi/python-packaging/DETAILS | 4
python-pypi/python-packaging/HISTORY | 3
qt6/qt6base/DETAILS | 2
qt6/qt6base/HISTORY | 4
qt6/qt6base/patches/abstract.diff | 81 +++++
qt6/qt6declarative/DETAILS | 2
qt6/qt6declarative/HISTORY | 4
qt6/qt6declarative/PRE_BUILD | 3
qt6/qt6declarative/patches/qml1.diff | 420 +++++++++++++++++++++++++++++++
qt6/qt6declarative/patches/qml2.diff | 473
+++++++++++++++++++++++++++++++++++
27 files changed, 1053 insertions(+), 19 deletions(-)

New commits:
commit 2f8767c639b14817e6eeb0b9bfa48d895b3fc253
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

qt6declarative - upstream patches

commit c25d89b201ed8607783b2753073989b37d007379
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

qt6base - upstream patch

commit 7db5d563bdda5c6cf665ae55d55c789e802dc1c4
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

firebird-driver: => 1.10.6

commit aad67cb74ae07749bd5bb59c206589942be38d90
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

python-packaging: => 24.1

commit 903fa9d63887c30b510e4581ad09421044e285a3
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

FUNCTIONS: fix pip install

commit bbb7ce9bd2f0cc2b002fd4e9f0b99360962aa350
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

pyparsing: => 3.1.4

commit 86aa68327e2cd043a96b4f2bf4fb4574919a459d
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

pyside6-tools: => 6.8.0

commit a2694896c9c7c95449e4e092f02e4638be3a1c50
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

pyside6: => 6.8.0

commit 51fbea8369fd11df4a6d16960f1bfb0716ec469d
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

shiboken6: => 6.8.0

commit b1cbe78147623c5cfc6b1678922678247a77682f
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

cmark - improve cmake usage

commit 6acf126d2ed1dab96714e1d3463f596282ced182
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

cmark: => 0.31.1

diff --git a/ChangeLog b/ChangeLog
index f457792..74974cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2024-10-11 Treeve Jelbert <treeve AT sourcemage.org>
+ * FUNCTIONS: fix pip install usage
+
2024-10-06 Ismael Luceno <ismael AT sourcemage.org>
* devel/smatch: new spell, Static analysis for C

diff --git a/FUNCTIONS b/FUNCTIONS
index 3a1169f..2da5ca1 100755
--- a/FUNCTIONS
+++ b/FUNCTIONS
@@ -491,7 +491,7 @@ function default_install_python3() {
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
if is_depends_enabled $SPELL pip;then
- pip install --root-user-action=ignore --no-index --no-user --find-links
-e .
+ python3 -m pip install --use-pep517 ${SOURCE_DIRECTORY}
else
python3 setup.py install --root "$INSTALL_ROOT/" "$@"
fi
diff --git a/devel/pyside6-tools/DETAILS b/devel/pyside6-tools/DETAILS
new file mode 100755
index 0000000..df74ed2
--- /dev/null
+++ b/devel/pyside6-tools/DETAILS
@@ -0,0 +1,17 @@
+source $GRIMOIRE/CMAKE_FUNCTIONS
+QTURL=https://download.qt.io/official_releases
+ SPELL=pyside6-tools
+ VERSION=6.8.0
+
SOURCE_HASH=sha512:e02338a12a15e4097f56e64eafd0fd97922eb60fd32a079064e4242f8863960d369364f2564f76404f8570936f851c4e7b5b3b9fc52333b29a3698644a77993a
+ SPELLX=pyside-setup-everywhere-src-${VERSION%.?}
+ SOURCE=$SPELLX.tar.xz
+ SOURCE_URL=$QTURL/QtForPython/pyside6/PySide6-$VERSION-src/$SOURCE
+SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELLX
+ WEB_SITE=https://www.pyside.org
+ ENTERED=20240924
+ LICENSE[0]=LGPL
+ KEYWORDS="qt6 python"
+ SHORT="PySide6 development tools"
+cat << EOF
+PySide6 development tools (pyuic and pyrcc)
+EOF
diff --git a/devel/pyside6-tools/HISTORY b/devel/pyside6-tools/HISTORY
new file mode 100644
index 0000000..ad04130
--- /dev/null
+++ b/devel/pyside6-tools/HISTORY
@@ -0,0 +1,6 @@
+2024-10-11 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: version 6.8.0
+
+2024-09-24 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: version 6.7.2
+ spell created
diff --git a/devel/pyside6/DETAILS b/devel/pyside6/DETAILS
index 440bdeb..d65b380 100755
--- a/devel/pyside6/DETAILS
+++ b/devel/pyside6/DETAILS
@@ -1,9 +1,10 @@
source $GRIMOIRE/CMAKE_FUNCTIONS
QTURL=https://download.qt.io/official_releases
SPELL=pyside6
- VERSION=6.7.3
-
SOURCE_HASH=sha512:5e4292b9809df571e1aa3db7c1366973aecf5aaba6638c78d676413985a965aa23b694ba287bdc1d9b8dca59ac24b8229021db6f5a2b5818c929cbada7ef7491
- SPELLX=pyside-setup-everywhere-src-$VERSION
+ SPELLX=pyside
+ VERSION=6.8.0
+
SOURCE_HASH=sha512:e02338a12a15e4097f56e64eafd0fd97922eb60fd32a079064e4242f8863960d369364f2564f76404f8570936f851c4e7b5b3b9fc52333b29a3698644a77993a
+ SPELLX=pyside-setup-everywhere-src-${VERSION%.?}
SOURCE=$SPELLX.tar.xz
SOURCE_URL=$QTURL/QtForPython/pyside6/PySide6-$VERSION-src/$SOURCE
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELLX
diff --git a/devel/pyside6/HISTORY b/devel/pyside6/HISTORY
index 4aad1f5..3ede01f 100644
--- a/devel/pyside6/HISTORY
+++ b/devel/pyside6/HISTORY
@@ -1,3 +1,6 @@
+2024-10-11 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: version 6.8.0
+
2024-10-01 Treeve Jelbert <treeve AT sourcemage.org>
* DETAILS: version 6.7.3

diff --git a/devel/shiboken6/DETAILS b/devel/shiboken6/DETAILS
index bcf3a18..8b8be37 100755
--- a/devel/shiboken6/DETAILS
+++ b/devel/shiboken6/DETAILS
@@ -1,9 +1,9 @@
source $GRIMOIRE/CMAKE_FUNCTIONS
QTURL=https://download.qt.io/official_releases
SPELL=shiboken6
- VERSION=6.7.3
-
SOURCE_HASH=sha512:5e4292b9809df571e1aa3db7c1366973aecf5aaba6638c78d676413985a965aa23b694ba287bdc1d9b8dca59ac24b8229021db6f5a2b5818c929cbada7ef7491
- SPELLX=pyside-setup-everywhere-src-$VERSION
+ VERSION=6.8.0
+
SOURCE_HASH=sha512:e02338a12a15e4097f56e64eafd0fd97922eb60fd32a079064e4242f8863960d369364f2564f76404f8570936f851c4e7b5b3b9fc52333b29a3698644a77993a
+ SPELLX=pyside-setup-everywhere-src-${VERSION%.?}
SOURCE=$SPELLX.tar.xz
SOURCE_URL=$QTURL/QtForPython/shiboken6/PySide6-$VERSION-src/$SOURCE
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELLX
diff --git a/devel/shiboken6/HISTORY b/devel/shiboken6/HISTORY
index bb7e1f4..4e0816b 100644
--- a/devel/shiboken6/HISTORY
+++ b/devel/shiboken6/HISTORY
@@ -1,3 +1,6 @@
+2024-10-11 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: version 6.8.0
+
2024-10-01 Treeve Jelbert <treeve AT sourcemage.org>
* DETAILS: version 6.7.3

diff --git a/doc/cmark/BUILD b/doc/cmark/BUILD
deleted file mode 100755
index e013b8d..0000000
--- a/doc/cmark/BUILD
+++ /dev/null
@@ -1 +0,0 @@
-cmake_build
diff --git a/doc/cmark/CONFIGURE b/doc/cmark/CONFIGURE
new file mode 100755
index 0000000..1e462ce
--- /dev/null
+++ b/doc/cmark/CONFIGURE
@@ -0,0 +1 @@
+. $GRIMOIRE/CMAKE_CONFIGURE
diff --git a/doc/cmark/DEPENDS b/doc/cmark/DEPENDS
new file mode 100755
index 0000000..b1c9561
--- /dev/null
+++ b/doc/cmark/DEPENDS
@@ -0,0 +1 @@
+. $GRIMOIRE/CMAKE_DEPENDS
diff --git a/doc/cmark/DETAILS b/doc/cmark/DETAILS
index f5fd629..9b71ea7 100755
--- a/doc/cmark/DETAILS
+++ b/doc/cmark/DETAILS
@@ -1,7 +1,8 @@
+. $GRIMOIRE/CMAKE_FUNCTIONS
SPELL=cmark
- VERSION=0.30.3
+ VERSION=0.31.1
SOURCE="$SPELL-$VERSION.tar.gz"
-
SOURCE_HASH=sha512:27383bfef95ae1390c26aff0dd2cbca33704e7d20116bf29da4695d2c9a4146b86daba0da1e91bdb9eab95671702f885e832b3d31d51601731f1dc630df5237b
+
SOURCE_HASH=sha512:3b4f8b47d8ea270078ab986aa22fc32b227786459bd33c7225aac578d8dd014e3d8788a6add60ea10571fdb4c7dc6a1ece960815a02f04f153b1775c73ccff8f
SOURCE_URL[0]=https://github.com/jgm/$SPELL/archive/$VERSION.tar.gz
SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-$VERSION"
WEB_SITE="https://commonmark.org/";
diff --git a/doc/cmark/HISTORY b/doc/cmark/HISTORY
index 017bbc2..e1d7183 100644
--- a/doc/cmark/HISTORY
+++ b/doc/cmark/HISTORY
@@ -1,3 +1,8 @@
+2024-10-11 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: version 0.31.1
+ * DEPENDS CONFIGURE: added
+ * BUILD: deleted
+
2023-05-15 Treeve Jelbert <treeve AT sourcemage.org>
* DETAILS: version 0.30.3

diff --git a/python-pypi/firebird-driver/DETAILS
b/python-pypi/firebird-driver/DETAILS
index 1ce8515..be0eb53 100755
--- a/python-pypi/firebird-driver/DETAILS
+++ b/python-pypi/firebird-driver/DETAILS
@@ -1,8 +1,8 @@
SPELL=firebird-driver
SPELLX=firebird_driver
- VERSION=1.10.4
-
VX=d6/45/e9a316ff100a54e5b19a146447b7af69aff63df02fda174b8a2a48c16903
-
SOURCE_HASH=sha512:d9753127491152ffb8715789e4d254c7fa8ea97502026d7dce52f3c813b14a8958b437c5f773ba22deec63e996f1e649f5031b62f19094487af20012f9dc867b
+ VERSION=1.10.6
+
VX=7c/f3/dd791b773d3e2146149cd59f91c3e1c865d4037bd65ef0ef5e8210ab8dc1
+
SOURCE_HASH=sha512:77e2d26821f3f0b295f8bd899bf34aa94362d20c72cd711ea0b2bbf1b1e3c2e204dd5fb410eec61d3cdf00429d4675defdc90a2eee20a63521cc4f5bfe2ce6e4
SOURCE=$SPELLX-$VERSION.tar.gz
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELLX-$VERSION
WEB_SITE=https://pypi.org/project/firebird-driver
diff --git a/python-pypi/firebird-driver/HISTORY
b/python-pypi/firebird-driver/HISTORY
index f28f4b3..48b7164 100644
--- a/python-pypi/firebird-driver/HISTORY
+++ b/python-pypi/firebird-driver/HISTORY
@@ -1,3 +1,6 @@
+2024-10-11 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: version 1.10.6
+
2024-06-22 Treeve Jelbert <treeve AT sourcemage.org>
* DETAILS: version 1.10.4

diff --git a/python-pypi/pyparsing/DETAILS b/python-pypi/pyparsing/DETAILS
index 9b53d07..6e51d2a 100755
--- a/python-pypi/pyparsing/DETAILS
+++ b/python-pypi/pyparsing/DETAILS
@@ -1,6 +1,6 @@
SPELL=pyparsing
- VERSION=3.1.2
-
SOURCE_HASH=sha512:1134949f3576edbec4438eefe952eb5cc6e734fb060905d714b6a77f71e90d364b01345df5e7b8fb5ffa798c530be9c65f6d152b3f591cba787660c4dd8894d2
+ VERSION=3.1.4
+
SOURCE_HASH=sha512:b475e5571510cd7b07fecbc8ae583b1e75a6308b64018d2884570dfa461e0529b96d02d11403cecac41f92b5d802a5dd4bbf9f8321d58ffa2d24cb89b86652e1
SOURCE="$SPELL-$VERSION.tar.gz"
SOURCE_URL[0]=https://pypi.io/packages/source/p/${SPELL}/${SOURCE}
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
diff --git a/python-pypi/pyparsing/HISTORY b/python-pypi/pyparsing/HISTORY
index d5073e7..93ecf21 100644
--- a/python-pypi/pyparsing/HISTORY
+++ b/python-pypi/pyparsing/HISTORY
@@ -1,3 +1,6 @@
+2024-10-11 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: version 3.1.4
+
2024-08-12 Treeve Jelbert <treeve AT sourcemage.org>
* BUILD INSTALL: deleted, use generic funcs

diff --git a/python-pypi/python-packaging/DETAILS
b/python-pypi/python-packaging/DETAILS
index ca3ca43..eaceb07 100755
--- a/python-pypi/python-packaging/DETAILS
+++ b/python-pypi/python-packaging/DETAILS
@@ -1,8 +1,8 @@
SPELL=python-packaging
- VERSION=24.0
+ VERSION=24.1
SOURCE="$SPELL-$VERSION.tar.gz"
SOURCE_URL[0]=https://github.com/pypa/packaging/archive/${VERSION}.tar.gz
-
SOURCE_HASH=sha512:bfffe6e677f3bdcaee87053caf5840396b694dfa771c37680282d70d62b6d928dae399a2da7f1a9ea2af482f1b61b353da0c6902d80ad932535995a8b21baabc
+
SOURCE_HASH=sha512:45836ea0e7531c485a7d5e568f9740c7f075ff1b72a0d60422c5b76c031866428ff2137d9bd153790a9fcfff6bd4a7555bc40555409ad46debae7f1c9c1fe129
SOURCE_DIRECTORY="${BUILD_DIRECTORY}/packaging-$VERSION"
WEB_SITE="https://github.com/pypa/packaging";
LICENSE="APACHE or BSD"
diff --git a/python-pypi/python-packaging/HISTORY
b/python-pypi/python-packaging/HISTORY
index 838e840..0d8d57b 100644
--- a/python-pypi/python-packaging/HISTORY
+++ b/python-pypi/python-packaging/HISTORY
@@ -1,3 +1,6 @@
+2024-10-11 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: version 24.1
+
2024-08-12 Treeve Jelbert <treeve AT sourcemage.org>
* BUILD INSTALL: deleted, use generic funcs

diff --git a/qt6/qt6base/DETAILS b/qt6/qt6base/DETAILS
index 7543561..31bc47b 100755
--- a/qt6/qt6base/DETAILS
+++ b/qt6/qt6base/DETAILS
@@ -1,7 +1,7 @@
SPELL=qt6base
source $GRIMOIRE/$SECTION/QT6_VERSIONS

-
+ PATCHLEVEL=1
SECURITY_PATCH=5
ENTERED=20210115
SHORT="Qt6 simplifies writing and maintaining GUI release-service"
diff --git a/qt6/qt6base/HISTORY b/qt6/qt6base/HISTORY
index 3d1983b..e75efb1 100644
--- a/qt6/qt6base/HISTORY
+++ b/qt6/qt6base/HISTORY
@@ -1,3 +1,7 @@
+2024-10-12 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: PATCHLEVEL++
+ * abstract.diff: upstream patch added
+
2024-09-24 Treeve Jelbert <treeve AT sourcemage.org>
* CVE-2024-39936-qtbase-6.7.patch: deleted

diff --git a/qt6/qt6base/patches/abstract.diff
b/qt6/qt6base/patches/abstract.diff
new file mode 100644
index 0000000..05e7fb2
--- /dev/null
+++ b/qt6/qt6base/patches/abstract.diff
@@ -0,0 +1,81 @@
+From 2ea3abed0125d81ca4f3bacb9650db7314657332 Mon Sep 17 00:00:00 2001
+From: Mitch Curtis <mitch.curtis AT qt.io>
+Date: Tue, 24 Sep 2024 10:40:37 +0800
+Subject: QAbstractItemModelPrivate: add resetting member
+
+This allows QQmlDelegateModel to know if a QAbstractItemModel subclass
+is in the process of a reset, which it can't know if beginResetModel
+was called in the model's constructor.
+
+As an added bonus, it also allows us to warn the user if they call
+endResetModel with a previous call to beginResetModel.
+
+Task-number: QTBUG-125053
+Task-number: QTBUG-127340
+Pick-to: 6.7 6.5
+Change-Id: I7d1fb983e9bf868c48472624ad945ae158115943
+Reviewed-by: Richard Moe Gustavsen <richard.gustavsen AT qt.io>
+(cherry picked from commit 9d8663c18e88cb0b5a65f86cfd7726f3d31e04d6)
+---
+ src/corelib/itemmodels/qabstractitemmodel.cpp | 13 +++++++++++++
+ src/corelib/itemmodels/qabstractitemmodel_p.h | 4 ++++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp
b/src/corelib/itemmodels/qabstractitemmodel.cpp
+index 5b9b215eab..3d4d566d46 100644
+--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
++++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
+@@ -3400,6 +3400,13 @@ void QAbstractItemModel::endMoveColumns()
+ */
+ void QAbstractItemModel::beginResetModel()
+ {
++ Q_D(QAbstractItemModel);
++ if (d->resetting) {
++ qWarning() << "beginResetModel called on" << this << "without
calling endResetModel first";
++ // Warn, but don't return early in case user code relies on the
incorrect behavior.
++ }
++
++ d->resetting = true;
+ emit modelAboutToBeReset(QPrivateSignal());
+ }
+
+@@ -3417,8 +3424,14 @@ void QAbstractItemModel::beginResetModel()
+ void QAbstractItemModel::endResetModel()
+ {
+ Q_D(QAbstractItemModel);
++ if (!d->resetting) {
++ qWarning() << "endResetModel called on" << this << "without calling
beginResetModel first";
++ // Warn, but don't return early in case user code relies on the
incorrect behavior.
++ }
++
+ d->invalidatePersistentIndexes();
+ resetInternalData();
++ d->resetting = false;
+ emit modelReset(QPrivateSignal());
+ }
+
+diff --git a/src/corelib/itemmodels/qabstractitemmodel_p.h
b/src/corelib/itemmodels/qabstractitemmodel_p.h
+index e34dc3262c..c2113fde9a 100644
+--- a/src/corelib/itemmodels/qabstractitemmodel_p.h
++++ b/src/corelib/itemmodels/qabstractitemmodel_p.h
+@@ -45,6 +45,8 @@ public:
+ QAbstractItemModelPrivate();
+ ~QAbstractItemModelPrivate();
+
++ static const QAbstractItemModelPrivate *get(const QAbstractItemModel
*model) { return model->d_func(); }
++
+ void removePersistentIndexData(QPersistentModelIndexData *data);
+ void movePersistentIndexes(const QList<QPersistentModelIndexData *>
&indexes, int change, const QModelIndex &parent,
+ Qt::Orientation orientation);
+@@ -115,6 +117,8 @@ public:
+ void insertMultiAtEnd(const QModelIndex& key,
QPersistentModelIndexData *data);
+ } persistent;
+
++ bool resetting = false;
++
+ static const QHash<int,QByteArray> &defaultRoleNames();
+ static bool isVariantLessThan(const QVariant &left, const QVariant
&right,
+ Qt::CaseSensitivity cs =
Qt::CaseSensitive, bool isLocaleAware = false);
+--
+cgit v1.2.3
+
diff --git a/qt6/qt6declarative/DETAILS b/qt6/qt6declarative/DETAILS
index 9d3f4de..fd7e93d 100755
--- a/qt6/qt6declarative/DETAILS
+++ b/qt6/qt6declarative/DETAILS
@@ -1,7 +1,7 @@
SPELL=qt6declarative
source $GRIMOIRE/$SECTION/QT6_VERSIONS

-
+ PATCHLEVEL=1
# SECURITY_PATCH=2
ENTERED=20210116
SHORT=""
diff --git a/qt6/qt6declarative/HISTORY b/qt6/qt6declarative/HISTORY
index 9234f67..e0d3b7a 100644
--- a/qt6/qt6declarative/HISTORY
+++ b/qt6/qt6declarative/HISTORY
@@ -1,3 +1,7 @@
+2024-10-12 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: PATCHLEVEL=1
+ * PRE_BUILD patches/*: upstream patches
+
2024-09-25 Treeve Jelbert <treeve AT sourcemage.org>
* DEPENDS: add qt6tools
* CONFLICTS" add self
diff --git a/qt6/qt6declarative/PRE_BUILD b/qt6/qt6declarative/PRE_BUILD
new file mode 100755
index 0000000..c230ad1
--- /dev/null
+++ b/qt6/qt6declarative/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+apply_patch_dir patches
diff --git a/qt6/qt6declarative/patches/qml1.diff
b/qt6/qt6declarative/patches/qml1.diff
new file mode 100644
index 0000000..dccd096
--- /dev/null
+++ b/qt6/qt6declarative/patches/qml1.diff
@@ -0,0 +1,420 @@
+From 3330731d0cb221477ab3d856db032126403ae6a0 Mon Sep 17 00:00:00 2001
+From: Mitch Curtis <mitch.curtis AT 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.7 6.5
+Change-Id: I8503b22a5257e0fb5ee11a1bdf83d3dcab4a600a
+Reviewed-by: Richard Moe Gustavsen <richard.gustavsen AT qt.io>
+(cherry picked from commit 281f620ceea03e7a222d796ae0cca917a9778368)
+Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot AT qt-project.org>
+---
+ 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 9af58d7a22..7cfa662aa6 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);
+ }
+
+@@ -1898,28 +1895,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()
+@@ -1929,23 +1923,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
+
diff --git a/qt6/qt6declarative/patches/qml2.diff
b/qt6/qt6declarative/patches/qml2.diff
new file mode 100644
index 0000000..47ac219
--- /dev/null
+++ b/qt6/qt6declarative/patches/qml2.diff
@@ -0,0 +1,473 @@
+From 2aefbca84d2f3dca2c2697f13710b6907c0c7e59 Mon Sep 17 00:00:00 2001
+From: Mitch Curtis <mitch.curtis AT qt.io>
+Date: Tue, 24 Sep 2024 10:22:12 +0800
+Subject: QQmlDelegateModel: fix delegates not being created in certain cases
+ v2
+
+Since 837c2f18cd223707e7cedb213257b0158ea07146, we connect to
+modelAboutToBeReset rather than modelReset so that we can handle role
+name changes. _q_modelAboutToBeReset now connects modelReset to
+handleModelReset with a single shot connection instead.
+
+However, it's possible for user code to begin the reset before
+connectToAbstractItemModel is called (QTBUG-125053), in which case we
+connect to modelReset too late and handleModelReset is never called,
+resulting in delegates not being created in certain cases.
+
+So, we check at the earliest point we can if the model is in the
+process of being reset, and if so, connect modelReset to
+handleModelReset.
+
+This is a less intrusive alternative to
+6561344dd2d1ba69abe6edec4fe340b256da9e13, which caused regressions and
+was reverted.
+
+Fixes: QTBUG-125053
+Task-number: QTBUG-127340
+Pick-to: 6.7 6.5
+Change-Id: I2bfe192ed61eddaa481de4b1e14b1fa5d07a51c1
+Reviewed-by: Richard Moe Gustavsen <richard.gustavsen AT qt.io>
+(cherry picked from commit 4bb16ce2c8ea94f768991593a581c8838d48f3a3)
+Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot AT qt-project.org>
+---
+ src/qmlmodels/qqmldelegatemodel.cpp | 17 ++
+ tests/auto/qml/qqmldelegatemodel/CMakeLists.txt | 1 +
+ .../proxyModelWithDelayedSourceModelInListView.qml | 30 +++
+ tests/auto/qml/qqmldelegatemodel/data/reset.qml | 28 +++
+ .../data/resetInQAIMConstructor.qml | 28 +++
+ .../qqmldelegatemodel/tst_qqmldelegatemodel.cpp | 210
++++++++++++++++++++-
+ 6 files changed, 304 insertions(+), 10 deletions(-)
+ create mode 100644
tests/auto/qml/qqmldelegatemodel/data/proxyModelWithDelayedSourceModelInListView.qml
+ create mode 100644 tests/auto/qml/qqmldelegatemodel/data/reset.qml
+ create mode 100644
tests/auto/qml/qqmldelegatemodel/data/resetInQAIMConstructor.qml
+
+diff --git a/src/qmlmodels/qqmldelegatemodel.cpp
b/src/qmlmodels/qqmldelegatemodel.cpp
+index 7cfa662aa6..f8de5cba82 100644
+--- a/src/qmlmodels/qqmldelegatemodel.cpp
++++ b/src/qmlmodels/qqmldelegatemodel.cpp
+@@ -3,6 +3,8 @@
+
+ #include "qqmldelegatemodel_p_p.h"
+
++#include <QtCore/private/qabstractitemmodel_p.h>
++
+ #include <QtQml/qqmlinfo.h>
+
+ #include <private/qqmlabstractdelegatecomponent_p.h>
+@@ -409,6 +411,21 @@ void QQmlDelegateModel::setModel(const QVariant &model)
+ _q_itemsInserted(0, d->adaptorModelCount());
+ d->requestMoreIfNecessary();
+ }
++
++ // Since 837c2f18cd223707e7cedb213257b0158ea07146, we connect to
modelAboutToBeReset
++ // rather than modelReset so that we can handle role name changes.
_q_modelAboutToBeReset
++ // now connects modelReset to handleModelReset with a single shot
connection instead.
++ // However, it's possible for user code to begin the reset before
connectToAbstractItemModel is called
++ // (QTBUG-125053), in which case we connect to modelReset too late and
handleModelReset is never called,
++ // resulting in delegates not being created in certain cases.
++ // So, we check at the earliest point we can if the model is in the
process of being reset,
++ // and if so, connect modelReset to handleModelReset.
++ if (d->m_adaptorModel.adaptsAim()) {
++ auto *aim = d->m_adaptorModel.aim();
++ auto *aimPrivate = QAbstractItemModelPrivate::get(aim);
++ if (aimPrivate->resetting)
++ QObject::connect(aim, &QAbstractItemModel::modelReset, this,
&QQmlDelegateModel::handleModelReset, Qt::SingleShotConnection);
++ }
+ }
+
+ /*!
+diff --git a/tests/auto/qml/qqmldelegatemodel/CMakeLists.txt
b/tests/auto/qml/qqmldelegatemodel/CMakeLists.txt
+index 8d8a90e0a7..966f5229df 100644
+--- a/tests/auto/qml/qqmldelegatemodel/CMakeLists.txt
++++ b/tests/auto/qml/qqmldelegatemodel/CMakeLists.txt
+@@ -29,6 +29,7 @@ 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/proxyModelWithDelayedSourceModelInListView.qml

b/tests/auto/qml/qqmldelegatemodel/data/proxyModelWithDelayedSourceModelInListView.qml
+new file mode 100644
+index 0000000000..b6733bd38c
+--- /dev/null
++++
b/tests/auto/qml/qqmldelegatemodel/data/proxyModelWithDelayedSourceModelInListView.qml
+@@ -0,0 +1,30 @@
++import QtQuick
++import Test
++
++Window {
++ id: root
++ title: listView.count
++
++ property alias listView: listView
++ property ProxySourceModel connectionModel: null
++
++ Component {
++ id: modelComponent
++ ProxySourceModel {}
++ }
++
++ ListView {
++ id: listView
++ anchors.fill: parent
++
++ delegate: Text {
++ text: model.Name
++ }
++
++ model: ProxyModel {
++ sourceModel: root.connectionModel
++ }
++ }
++
++ Component.onCompleted: root.connectionModel =
modelComponent.createObject(root)
++}
+diff --git a/tests/auto/qml/qqmldelegatemodel/data/reset.qml
b/tests/auto/qml/qqmldelegatemodel/data/reset.qml
+new file mode 100644
+index 0000000000..0fcd5e8afa
+--- /dev/null
++++ b/tests/auto/qml/qqmldelegatemodel/data/reset.qml
+@@ -0,0 +1,28 @@
++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
+new file mode 100644
+index 0000000000..cb1f226737
+--- /dev/null
++++ b/tests/auto/qml/qqmldelegatemodel/data/resetInQAIMConstructor.qml
+@@ -0,0 +1,28 @@
++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 2cacda5513..3f08d8fc85 100644
+--- a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
++++ b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
+@@ -3,7 +3,9 @@
+
+ #include <QtTest/qtest.h>
+ #include <QtCore/qjsonobject.h>
++#include <QtCore/qsortfilterproxymodel.h>
+ #include <QtCore/QConcatenateTablesProxyModel>
++#include <QtCore/qtimer.h>
+ #include <QtGui/QStandardItemModel>
+ #include <QtQml/qqmlcomponent.h>
+ #include <QtQml/qqmlapplicationengine.h>
+@@ -11,11 +13,17 @@
+ #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
+@@ -25,6 +33,8 @@ public:
+
+ private slots:
+ void resettingRolesRespected();
++ void resetInQAIMConstructor();
++ void reset();
+ void valueWithoutCallingObjectFirst_data();
+ void valueWithoutCallingObjectFirst();
+ void qtbug_86017();
+@@ -42,18 +52,12 @@ private slots:
+ void doNotUnrefObjectUnderConstruction();
+ void clearCacheDuringInsertion();
+ void viewUpdatedOnDelegateChoiceAffectingRoleChange();
++ void proxyModelWithDelayedSourceModelInListView();
+ };
+
+-class AbstractItemModel : public QAbstractItemModel
++class BaseAbstractItemModel : 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())
+@@ -91,10 +95,21 @@ public:
+ return mValues.at(index.row());
+ }
+
+-private:
++protected:
+ 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)
+ {
+@@ -153,7 +168,109 @@ void tst_QQmlDelegateModel::resettingRolesRespected()
+ QObject *root = engine.rootObjects().constFirst();
+ QVERIFY(!root->property("success").toBool());
+ model->change();
+- QTRY_VERIFY(root->property("success").toBool());
++ 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");
+ }
+
+ void tst_QQmlDelegateModel::valueWithoutCallingObjectFirst_data()
+@@ -616,6 +733,79 @@ void
tst_QQmlDelegateModel::viewUpdatedOnDelegateChoiceAffectingRoleChange()
+ QVERIFY(returnedValue);
+ }
+
++class ProxySourceModel : public QAbstractListModel
++{
++ Q_OBJECT
++ QML_ELEMENT
++public:
++ explicit ProxySourceModel(QObject *parent = nullptr)
++ : QAbstractListModel(parent)
++ {
++ for (int i = 0; i < rows; ++i) {
++ beginInsertRows(QModelIndex(), i, i);
++ endInsertRows();
++ }
++ }
++
++ ~ProxySourceModel() override = default;
++
++ int rowCount(const QModelIndex &) const override
++ {
++ return rows;
++ }
++
++ QVariant data(const QModelIndex &, int ) const override
++ {
++ return "Hello";
++ }
++
++ QHash<int, QByteArray> roleNames() const override
++ {
++ QHash<int, QByteArray> roles = QAbstractListModel::roleNames();
++ roles[Qt::UserRole + 1] = "Name";
++
++ return roles;
++ }
++
++ static const int rows = 1;
++};
++
++class ProxyModel : public QSortFilterProxyModel
++{
++ Q_OBJECT
++ QML_ELEMENT
++ Q_PROPERTY(QAbstractItemModel *sourceModel READ sourceModel WRITE
setSourceModel)
++
++public:
++ explicit ProxyModel(QObject *parent = nullptr)
++ : QSortFilterProxyModel(parent)
++ {
++ }
++
++ ~ProxyModel() override = default;
++};
++
++// Checks that the correct amount of delegates are created when using a
proxy
++// model whose source model is set after a delay.
++void tst_QQmlDelegateModel::proxyModelWithDelayedSourceModelInListView()
++{
++ QTest::failOnWarning();
++
++ qmlRegisterTypesAndRevisions<ProxySourceModel>("Test", 1);
++ qmlRegisterTypesAndRevisions<ProxyModel>("Test", 1);
++
++ QQuickApplicationHelper helper(this,
"proxyModelWithDelayedSourceModelInListView.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);
++ const auto delegateModel = QQuickItemViewPrivate::get(listView)->model;
++ QTRY_COMPARE(listView->count(), 1);
++}
++
+ QTEST_MAIN(tst_QQmlDelegateModel)
+
+ #include "tst_qqmldelegatemodel.moc"
+--
+cgit v1.2.3
+


  • [[SM-Commit] ] GIT changes to master grimoire by Treeve Jelbert (2f8767c639b14817e6eeb0b9bfa48d895b3fc253), Treeve Jelbert, 10/12/2024

Archive powered by MHonArc 2.6.24.

Top of Page