Qt Declarative (Quick 2)
Go to file
Fabian Kosmale 837c2f18cd DelegateModel: handle roleName invalidation
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. DelegateModel did so far not take this into account.

Handle this case correctly 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.

Note that some views, e.g. TableView do not use DelegateModel if they
detect that the model is a QAIM. They require a conceptually similar
fix (but can probaly implement this in a more efficient way).

Fixes: QTBUG-32132
Fixes: QTBUG-103220
Pick-to: 6.2 6.5
Change-Id: I6874988cf09b8fe75d2e9750d0bf209915554c45
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-03-16 22:39:00 +01:00
LICENSES Use SPDX license identifiers 2022-06-11 08:05:15 +02:00
cmake Make Sure that `qml_compile_hash_p.h` Isn't Missing 2022-10-26 14:02:58 +02:00
coin QML DOM: Remove support for Qt < 6.5 2023-01-30 15:58:11 +01:00
dist Merge qtquickcontrols2 into qtdeclarative 2021-07-28 11:21:25 +02:00
examples Gallery example: translate all user facing strings 2023-03-16 16:21:34 +01:00
features Add the skeleton for a D3D12 backend 2016-02-19 14:51:37 +00:00
src DelegateModel: handle roleName invalidation 2023-03-16 22:39:00 +01:00
tests DelegateModel: handle roleName invalidation 2023-03-16 22:39:00 +01:00
tools qmltyperegistrar: Guard against file system failures 2023-02-17 11:06:21 +01:00
.cmake.conf Remove QT_USE_SYNCQT_CPP 2023-01-02 19:43:56 +01:00
.gitattributes qmlformat: improve testing of file based options 2021-11-04 13:35:48 +01:00
.gitignore Remove "2" from Qt Quick Controls directories 2022-12-01 10:26:20 +08:00
.gitmodules Update to the latest version of the ecmascript test suite 2018-04-26 20:26:36 +00:00
.tag Use tree hash rather than commit hash in .tag file 2022-01-25 23:55:27 +01:00
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-09-07 17:01:30 +02:00
README.md Rewrite README.md 2021-08-12 13:15:17 +00:00
conanfile.py Use SPDX license identifiers 2022-06-11 08:05:15 +02:00
configure.cmake Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-09-07 17:01:30 +02:00
dependencies.yaml Update dependencies on 'dev' in qt/qtdeclarative 2023-03-10 22:42:49 +00:00
qt_cmdline.cmake Remove "2" from Qt Quick Controls directories 2022-12-01 10:26:20 +08:00
qtdeclarative.doxy Add doxyfile for building doxygen documentation 2018-08-16 15:54:40 +00:00
sync.profile qmlls: move into own private static library 2023-02-07 19:23:13 +01:00