running pyqt app event loop in secondary thread, using (Py)Qt6.5
Stefan Seefeld
stefan at seefeld.name
Fri Sep 22 23:48:53 BST 2023
Hi Jeremy,
thank you very much for following up !
On Fri, Sep 22, 2023 at 6:36 PM Jeremy Katz <jkatz at volexity.com> wrote:
>
> I went searching for Qt 6 references to QCoreApplication.quit, as this
> has changed from Qt 5. Qt 5 makes no promises.
> https://doc.qt.io/qt-6/qcoreapplication.html#quit says:
> Thread-safety note: this function may be called from any thread to
> thread-safely cause the currently-running main application loop to exit.
> However, thread-safety is not guaranteed if the QCoreApplication object
> is being destroyed at the same time.
>
I'm not sure what "at the same time" means. At least in my sample code, I'm
really calling the `quit()` function from a different thread (while the
event loop is still running, of course), and am only destroying the
application after the `exec()` function has completed.
>
> Unless the application is setting up a connection, there is no signal
> routing involved.
>
I'm also not sure what this means. Am I supposed to connect
`Application.quit` to `Application.exit` myself ? I thought Qt would handle
that internally, and route the signal appropriately, depending on whether
the signal comes from the same thread or not.
Thanks,
--
...ich hab' noch einen Koffer in Berlin...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20230922/99108372/attachment.htm>
More information about the PyQt
mailing list