[PyQt] QApplication was not created in the main()

Alan Ezust alan.ezust at gmail.com
Mon Jul 28 17:18:27 BST 2014

On Mon, Jul 28, 2014 at 7:14 AM, Gelonida N <gelonida at gmail.com> wrote:

> Hi Alan,
> On 7/26/2014 7:35 PM, Alan Ezust wrote:
>> You are only supposed to create one QApplication, and that should be
>> main. Why do you want to create a second one somewhere else? That is
>> probably a mistake.
> I think I did not express myself very well.
> I do not want to create a second instance of a QApplication.
> I just want to know whether I can create an application from a thread
> which is NOT the main thread.

Why would you want to? What problem does it solve?

> I do not intend to create multiple QApplications, but wanted to know, what
> is so special about the main thread and why PyQt tells me, that I should
> create my GUI in the main thread.

That is a Qt limitation, not just a PyQt limitation. Because the GUI
classes are not thread-safe.
Other languages/frameworks have similar restrictions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140728/bba227b4/attachment.html>

More information about the PyQt mailing list