Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.15.4, 6.1.1
-
None
-
Windows 10 64bit 19043, Python 3.9.6
Description
I'm trying to write a model (QAbstractItemModel child class) to populate data into a QTreeView. I need the items to be checkable and want to later filter out everything that is not checked. To achieve correct hiding of items that have been unchecked when filtering is active, I need to emit layoutChanged in my setData method. Nevertheless, this one signal (in combination with layoutAboutToBeChanged) leads to unpredictable crashes when checking items. I narrowed it down to the following code example, I know two things that will prevent crashes when checking items:
- Remove the QSortFilterProxyModel
- Do not emit the layoutChanged signal
Nevertheless, both are vital to my filtering (which I took out of the example code since it's too much anyway). To reproduce, you can just select an item and press the space bar - won't take long until the app crashes (it also crashes without that monkey test, but this is fast to reproduce). I already checked it with QtModelTester from pytest-qt - it's ok.
Example code: https://pastebin.com/HYx4UzbK