[Ubuntu] PyQt5

Laura Creighton lac at openend.se
Sun Nov 8 05:20:12 EST 2015


In a message of Sun, 08 Nov 2015 06:36:26 +0100, Vincent Vande Vyvre writes:
>Le 08/11/2015 04:13, Andrew Diamond a écrit :
>> Hi!
>>
>> I'm fairly new to Python, and installed pyqt5 and began working through the examples at http://zetcode.com/gui/pyqt5/menustoolbars/  However, whenever I click one of the buttons or menus in the example apps I run that is supposed to quit the application, it locks up.  This happens with all the examples I installed that handle code to quit the app.
>>
>> Running Ubuntu 15.10, and installed pyqt5 via:
>>
>> sudo apt-get install python3-pyqt5
>> sudo apt-get install qtcreator
>>
>> Thank you in advance for any assistance!
>Works fine for me on 15.04.
>
>I've tested the first example with the menuBar.
>
>Have you a message into the terminal? Maybe an error?
>
>Vincent

A suggestion:

When I get the 'it locks up when I want to quit' behaviour
in PyQt4 it is because I have messed up something with my threading.
PyQt4 wants there to be one, main control thread (that handles, among
other things, shutting down) and lots of worker threads which do the
gui-stuff, i.e. all the work that the program really needs to do.

If you manage to structure things so that your control ends up in
a worker thread, then when it is told to quit, your app sits around
and waits for the main control thread to come back and deal with things,
but your main control thread is dead, and therefore isn't coming.

I assume you can get problems like this with Qt5 as well.

Did quitting work properly with the earlier exercises of this tutorial,
or did you try to start learning from the middle?

Laura



More information about the Python-list mailing list