Qt Declarative (Quick 2)
Go to file
Santhosh Kumar 1b51dade3a Release section item when the corresponding view item removed
The section item has not been removed or added to the section cache
in all cases when the corresponding delegate item has been moved out
of the visible area, either during flick or scroll. This happens in
a case where the delegate item has been requested to be removed (as
it goes out of the visible area) from the list view, but it's not
released from the delegate model due to its caching mechanism. When
an item is outside the visible area, releaseItem() is triggered,
intended to free the item and its sections. The problem arises when
releaseItem() calls QQmlInstanceModel::release(), which caches the
item in the delegate model, but does not free the section. This
prevents the section item from being released properly.

This patch releases the section item whenever removeItem is
triggered from the list view, which happens when the delegate item
is moved out of the visible area.

Fixes: QTBUG-137172
Pick-to: 6.8 6.5
Change-Id: Ib7e78309e076e76750b03f3238a7501563a3962a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 5a664f0836)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d0287165a7)
2025-09-13 11:15:07 +00:00
LICENSES Add REUSE.toml files and missing licenses 2024-10-29 14:00:19 +02:00
cmake Use `_qt_internal_set_source_file_generated` 2025-06-26 08:15:23 +00:00
coin Make module ready for source SBOM checking 2025-02-22 01:45:41 +00:00
dist Add REUSE.toml files and missing licenses 2024-10-29 14:00:19 +02:00
examples Gallery example: Brush up the .cpp file 2025-09-12 05:40:09 +00:00
features
src Release section item when the corresponding view item removed 2025-09-13 11:15:07 +00:00
tests Release section item when the corresponding view item removed 2025-09-13 11:15:07 +00:00
tools qmltc: Don't crash on missing type information 2025-08-06 00:28:32 +00:00
.cmake.conf Bump version to 6.9.3 2025-08-14 13:58:30 +01:00
.gitattributes qmlformat: improve testing of file based options 2021-11-04 13:35:48 +01:00
.gitignore gitignore: Add compile_commands.json and .ccache 2024-05-16 17:25:19 +02:00
.gitmodules
.gitreview Add .gitreview file 2025-02-26 23:29:52 +00:00
.tag Use tree hash rather than commit hash in .tag file 2022-01-25 23:55:27 +01:00
CMakeLists.txt Add RunCMake tests 2025-03-25 00:27:51 +00:00
README.md Rewrite README.md 2021-08-12 13:15:17 +00:00
REUSE.toml Update licensing of files with infrastructure type 2025-03-13 18:22:20 +00: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 '6.9' in qt/qtdeclarative 2025-08-22 03:58:45 +00:00
licenseRule.json Update licensing of files with infrastructure type 2025-03-13 18:22:20 +00:00
qt_cmdline.cmake Remove "2" from Qt Quick Controls directories 2022-12-01 10:26:20 +08:00
qtdeclarative.doxy