[PyQt] QCoreApplication::exec: The event loop is already running

Brent Villalobos Brent.Villalobos at pdi.dreamworks.com
Mon Mar 2 18:38:10 GMT 2009


I have a pyqt application that imports and runs another pyqt 
application.  I am not launching the second application in its own 
process, but I'm just relying on python's module importing 
architecture.  Both applications seems to run fine without any problems, 
but I'm seeing this warning message:
    QCoreApplication::exec: The event loop is already running

While everything seems to run fine I feel like I'm doing something wrong 
and I will eventually be bitten by some odd side effect.  Are these 
fears warranted?  I know that the Qt documentation says that you should 
only have one QApplication instance so is this just warning and Qt is 
doing the right thing "under the hood?"

If this will create problems, can you provide some suggestions on what I 
should do differently?  I want to avoid launching a second process if 
possible.  Is it possible for one QApplication instance to manage 
multiple gui applications without problems?

Finally, if there is no problem is there a way I can suppress that 
warning so that users don't freak out?  Thanks.
-Brent


More information about the PyQt mailing list