Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
4.6.1
-
None
-
Linux
Description
In one instance source_items_removed() is given start=219, end=219, and the proxy_to_source mapping contains the following:
{218,219,220,234}.
source_items_removed() will not remove 219, leaving proxy_to_source.size() = 4.
source_items_removed() will iterate over proxy_to_source and update its values to:
{218,218,219,233}. this introduces duplicates in the proxy_to_source mapping that are not fixed during the course of source_items_removed().
note that source_items_removed() does shrink the source_to_proxy mapping to reflect the new item count (but not the proxy_to_source mapping).
after adding the following code, a mysterious crash in index_to_iterator() is no longer observed (starting at line 823 of qsortfilterproxymodel.cpp):
// shrink the proxy-to-source mapping to reflect the new item count
for (QVector<int>::iterator it2 = proxy_to_source.begin();
it2 != proxy_to_source.end() {
int idx = *it2;
if (idx >= start && idx <= end)
else
{ ++it2; }}
Attachments
Issue Links
- is replaced by
-
QTBUG-8841 QSortFilterProxyModel crashes when two proxies with dynamicSortFilter on share a same source model and some rows are deleted in it.
- Closed