[PyKDE] Exceptions in callbacks

Pete Ware ware at cis.ohio-state.edu
Mon Feb 5 22:33:33 GMT 2001

Bruce Sass <bsass at freenet.edmonton.ab.ca> writes:

> ...but, if Qt/PyQt does not have a hook into where you want, the only
> solution may be to expect the unexpected.
And that is just what I am asking for (unless someone can think of a
better method).  What I suggested was something like:

        qt.set_exception_handler (some_function)

so that some_function() gets called when the PyQt code catches that

It'd be great to be able to do:

        while 1:
                        app.exec_loop ()
                        QMessageBox.warning (parent, 'title',
                                'Unanticipated exception')

though I don't know if Qt's exec() is reentrant and we should probably
not break old code that doesn't expect the exec_loop() to ever quit.


More information about the PyQt mailing list