Qt-interest Archive, September 2007
Re: QProgressBar in a separate thread?
Message 1 in thread
André Somers wrote:
>Jones, Torrin A (US SSA) wrote:
>
>
>
>>Create a function in the thread that tells the threads status. In the
>>main thread (gui thread), call that function, get the status and update
>>the progress bar accordingly.
>>
>>
>That sounds like polling, and is in my view quite dirty. I'd go with the
>already given solution: just send off a signal from your worker to your gui
>thread and connect them using a queued connection.
>
>André
>
>
Andre,
Let you know that the problem got solved by emitting a signal, which is
connected to a slot in the GUI thread by Qt::BlockingQueuedConnection.
This type of connection is new, which was introduced in Qt 4.3.0. Use
Qt::QueuedConnection is fine too, though it sometime may not very well
synchronized.
Thank you very much,
Lingfa
--
[ signature omitted ]