[PyQt] QApplication.notify exception?

Florian Bruhin me at the-compiler.org
Mon May 27 09:55:55 BST 2019


Hey,

On Sun, May 26, 2019 at 04:52:20PM -0400, Kyle Altendorf wrote:
> On 2019-05-26 16:37, Matic Kukovec wrote:
> 
> > Hi guys,
> > 
> > I have an application that runs without a problem on Windows, but on
> > Linux it shows this message on exit:
> > 
> > > Qt has caught an exception thrown from an event handler. Throwing
> > > exceptions from an event handler is not supported in Qt.
> > > You must not let any exception whatsoever propagate through Qt code.
> > > If that is not possible, in Qt 5 you must at least reimplement
> > > QCoreApplication::notify() and catch all exceptions there.
> 
> I use sys.excepthook to provide a log and dialog for otherwise unhandled
> Python exceptions.  Maybe see if that can at least let you see what
> exception is causing trouble?  But I honestly haven't ever seen a reference
> to this message before...  :|

That message is coming from Qt, which doesn't know about Python exceptions.

I'm guessing it's referring to C++ exceptions, which you won't catch in Python
via an excepthook or "except".

So the question is why there's a C++ exception thrown, and from where... No
idea how to debug that to be honest. Maybe you can get gdb to break on any
exception or something?

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/20190527/dbb482f7/attachment.sig>


More information about the PyQt mailing list