[PyQt] QTreeView + sort + delete = crash

Florian Bruhin me at the-compiler.org
Mon May 6 08:00:04 BST 2019


Hey,

On Sun, May 05, 2019 at 08:52:13PM -0500, John F Sturtz wrote:
> I suspect the reason that the version I posted crashed was because I tried to
> instantiate the dialog widget (Dlg) from the tester function.  The tester
> function doesn't create a QApplication, so it was foolish of me to think it
> could create a widget there.

That should actually work, since pytest-qt creates a QApplication internally.

> So, there doesn't seem to be anything obvious wrong with the model, at least
> not as far as the pytest-qt item model tester is concerned.  Which means I'm
> not much closer to knowing why the original code I posted crashes than I was
> before.  :-/

Note the model tester continues to observe your model while you interact with
it.

You might want to either find an automated way to reproduce the bug you've
seen, or add a qtbot argument, add "qtbot.add_widget(dlg)" at the beginning,
and "qtbot.stop()" after setting up the model tester.

That should allow you to interact with the widget manually while the model
checker continues to run.

Florian

-- 
https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
         I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190506/50c78f16/attachment.sig>


More information about the PyQt mailing list