Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
4.8.3, 4.8.4
-
None
-
$ uname -a
Linux DimanNeYa 3.5.0-23-generic #35-Ubuntu SMP Thu Jan 24 13:15:40 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
qt-4.8.3
============ and ============
FreeBSD 9.0-STABLE
qt-4.8.4$ uname -a Linux DimanNeYa 3.5.0-23-generic #35-Ubuntu SMP Thu Jan 24 13:15:40 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.10 Release: 12.10 Codename: quantal qt-4.8.3 ============ and ============ FreeBSD 9.0-STABLE qt-4.8.4
-
989e6c5ee6f3e38b24632ec5caf49c5b03d17aed
Description
Sequence of steps to reproduce crash:
1)Create tree similar to
root |-- ch1 | |-- n1 | |-- ch2 |- n2
2)Filter out ch1 and ch2 with QSortFilterProxyModel::filterAcceptsRow
3) Try to remove 1st and 2nd rows (ch1 and ch2)
4) CRASH!
My initial investigation and gdb say that in function
void QSortFilterProxyModelPrivate::updateChildrenMapping(const QModelIndex &source_parent, Mapping *parent_mapping, Qt::Orientation orient, int start, int end, int delta_item_count, bool remove)
at line
Mapping *cm = source_index_mapping.take(source_child_index);
you get null cm, because hash source_index_mapping does not contain such source_child_index index and then you are trying to use it.
In attachment is minimal example to reproduce the bug.
P.S. Yes, I know that I can say to function removeRows to remove two rows at once, but this example was taken from real big programme, and in this real programme it is difficult and not efficiently to combine separate rows in one bundle.