[Qt-interest] Mainthread is busy though WorkerThread::run() is finished

Andre Somers andre at familiesomers.nl
Tue Sep 1 11:51:07 CEST 2009


Santhosh Y wrote:
> Hi,
>
> Please find the attached files with the mail.
>
> It is a compiling code.
>
> What I tried is the following:-
>
>    1. MainThread,  holds the GUI elements
>    2. WorkerThread allots storage and adds to GUI element of MainThread
>           * QTableWidgetItem setting into QTableWidget
>
>
> My qn here is that, once the workerThread finishes run() 
> implementation, MainThread is still busy. How to solve this issue.
>
> In the code I attached, I hold QTableWidget on MainThread and I tried 
> to set cell items of table in worker thread; But as soon as I finish 
> adding cell items GUI has to be active.
> But in my case it is not responding.
>
>
> Please answer some body the reason for the above behavior.
>
Please READ the answers to your previous question.
You can do NO GUI RELATED THINGS from another thread. That includes 
"adding to GUI elements" or changing QTableWidgetItems or adding them to 
a QTableWidget. In worker threads, keep away from the GUI!

André





More information about the Qt-interest-old mailing list