[PySide] Keeping GUI responsive

Tim Roberts timr at probo.com
Thu Dec 5 19:05:54 CET 2019

Stephen Morris via PySide wrote:
> I’m not sure if running PySide from a Python interpreter in another 
> thread can ever work, since Qt itself will only run a GUI from the 
> main thread, and in any case PySide appears to share the main 
> QApplication with the C++ Qt GUI.
In a technical and quite pedantic sense, this is not exactly true.  It's 
nitpicking, but the difference matters in a very few cases.

Qt will run in the thread where application.exec() runs.  PySide will 
run in the thread where app.exec_() runs.  Strictly speaking,n either 
has to be the process' main thread, although it almost always is.  It 
should be possible to have a message loop running in both threads, 
although the windows will stay separate; windows created in thread 1 
will have their messages handled in thread 1, and windows created in 
thread 2 will have their messages handled in thread 2.  Having the 
windows interact with each other is a guru-level operation.

Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20191205/e5ca6c4e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3389 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20191205/e5ca6c4e/attachment.bin>

More information about the PySide mailing list