<div dir="ltr"><div>Hello,</div><div><br></div><div>I made a PyQt application which has been working without any issues for quite some time. I updated PyQt6 from 6.9.0 to 6.9.1 and only now I get a segmentation fault related to mapping indices with a QSortFilterProxyModel while the source model is being updated.</div><div><br></div><div>What my code did previously was something like this, in Pythonesque pseudocode:<br><br></div><div>custom_source_model.beginResetModel()</div><div>
custom_source_model.load_data(new_data)</div><div>source_index = custom_source_model.get_index(some_item)</div><div>proxy_index = proxy.mapFromSource(source_index) # crash occurs here<br></div><div># irrelevant lines of code which utilize the proxy_index somehow...</div><div>
custom_source_model.endResetModel()<br><br></div><div>My understanding is that what I did is incorrect and I should not perform any operations on the proxy model while the main model is in reset. When I postpone these index related operations until after the custom_source_model.endResetModel() call, the segmentation fault does not occur.</div><div><br></div><div>What I would like to know is, what changed in 6.9.1 that makes this segmentation fault occur? The release notes do not document any change which would explain this. </div><div>The reason why I am asking is twofold: 1) to fully explain the appearance of this segfault in 6.9.1 and 2) to find out whether there are any other hidden changes that could uncover pre-existing errors in my code.</div><div><br></div><div>Thank you very much.</div><div><br></div><div>Kind regards</div><div>Jakub</div></div>