[PyQt] Exception dialog for pyqt5.dll Designer plugin

Kyle Altendorf sda at fstab.net
Tue Jul 18 18:11:57 BST 2017


Following up on an old thread [0].

I went ahead and shoved my PyQt5 application's exception dialog into the 
Designer
plugin so I could get exceptions there as well.  Screenshot at [1].  A 
patch is
available on GitHub [2].  Builds of pyqt5-tools with it on AppVeyor [3]. 
  Of course,
I'd like something like this put into the official source but this is my 
first
foray into the Python C API so the form may not be appreciated.

Brief overview...  excepthook.py is roughly my application's PyQt5 
dialog code.
generate_module_literal.py is used to convert excepthook.py into 
excepthook.c
which is excepthook.py as a char[] plus it's name.  The existing 
pluginloader.dll
loads that 'string' as a python module which registers the custom 
sys.excepthook
that shows the dialog.

If you're interested enough to try it out, let me know how it works for 
you.

Cheers,
-kyle


[0] 
https://www.riverbankcomputing.com/pipermail/pyqt/2016-August/037879.html
[1] https://pasteboard.co/GBwYwOL.png
[2] 
https://github.com/altendky/pyqt5-tools/blob/36a0d1e6f525a52dc7d70e5acfc6b0c1800a7c07/pluginloader.patch
[3] https://ci.appveyor.com/project/KyleAltendorf/pyqt5-tools/build/254


More information about the PyQt mailing list