[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: running pyqt app event loop in secondary thread, using (Py)Qt6.5
From:       Stefan Seefeld <stefan () seefeld ! name>
Date:       2023-09-22 22:48:53
Message-ID: CAOEGfx3B0fz9i7SXvL6R51SphjEpvphVPDnBwO1P7ArRAWtMtg () mail ! gmail ! com
[Download RAW message or body]

Hi Jeremy,

thank you very much for following up !

On Fri, Sep 22, 2023 at 6:36 PM Jeremy Katz <jkatz@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...

[Attachment #3 (text/html)]

<div dir="ltr"><div dir="ltr"><div>Hi Jeremy,</div><div><br></div><div>thank you very \
much for following up !<br></div></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Fri, Sep 22, 2023 at 6:36 PM Jeremy Katz &lt;<a \
href="mailto:jkatz@volexity.com">jkatz@volexity.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br> I went searching \
for Qt 6 references to QCoreApplication.quit, as this <br> has changed from Qt 5. Qt \
5 makes no promises.<br> <a href="https://doc.qt.io/qt-6/qcoreapplication.html#quit" \
rel="noreferrer" target="_blank">https://doc.qt.io/qt-6/qcoreapplication.html#quit</a> \
says:<br> Thread-safety note: this function may be called from any thread to <br>
thread-safely cause the currently-running main application loop to exit. <br>
However, thread-safety is not guaranteed if the QCoreApplication object <br>
is being destroyed at the same time.<br></blockquote><div><br></div><div>I&#39;m not \
sure what &quot;at the same time&quot; means. At least in my sample code, I&#39;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.<br></div><div><br></div><div>  </div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> <br>
Unless the application is setting up a connection, there is no signal <br>
routing involved.<br>
</blockquote></div><br clear="all"><div>I&#39;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.<br></div><div><br></div><div>Thanks,<br></div><span \
class="gmail_signature_prefix">-- </span><br><div dir="ltr" \
class="gmail_signature"><div dir="ltr"><div><img \
src="https://ci3.googleusercontent.com/mail-sig/AIorK4yh4RzsqlxV6irScDGRVZ8a7NRCh_INtp \
PsAHx2Y8v4Vu3VKsI54RFNs3YRZk_2xTTtMMdSCzdNrf5XRUlmF4BkezmtZv-j5c3A4G0hEA"></div><div><pre> \
...ich hab&#39; noch einen Koffer in Berlin... </pre></div></div></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic