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

David Boddie dboddie at trolltech.com
Mon Mar 2 20:08:23 GMT 2009


On Mon Mar 2 19:12:00 GMT 2009, Brent Villalobos wrote:
> Brian Kelley wrote:
> > When you start another mainwindow (or top level widget for that
> > matter) you don’t need to call exec_ or make another QApplication.
>
> That's good. Along those same lines does Qt provide a way of querying
> whether a QApplication loop is already running so you can avoid making a
> new one?

If you really need to know, it may be possible to tell by attempting to
obtain a QAbstractEventDispatcher instance.

Call the QAbstractEventDispatcher.instance() static method to see if one
has been created:

http://www.riverbankcomputing.com/static/Docs/PyQt4/html/qabstracteventdispatcher.html#instance

David



More information about the PyQt mailing list