Yes I'm using pthread, I'm passing the main window object (which having 150 line edits) to the thread, and updating the line edits from the threads.
I have tried using QThread, which also showing the same issue.
Yes I'm using pthread, I'm passing the main window object (which having 150 line edits) to the thread, and updating the line edits from the threads.
I have tried using QThread, which also showing the same issue.
Read this carefully: http://doc.trolltech.com/3.3/threads.html
Especially the part that says you can't touch the GUI from a non-GUI thread.
Last edited by jacek; 8th September 2008 at 14:05. Reason: fixed Qt version in the link
I tried with the QThread also, which is not working. I am uploading the sample program, that I have done using QThread. Thanks in Advance .....
Could you repeat my previous post with your own words?
Thanks a lot for that the XLib problems are not coming for QThread. But a new problems arise, if I'm using (for the samples I've attached in my previous post) QThread the main window is not coming properly (It's getting hanged), in the document also I could not get any solution for this, can anybody help me ?
To my orginal problem, can I do parallel GUI updation in QT ? Is there any way to do parallel processing with continuous parallel updation GUI in QT? thanks in advance .
The main thread (a.k.a. the GUI thread) is the one that created the QApplication instance.
Typical way of communication between worker threads and the GUI thread is to use custom events. QApplication provides some locking mechanism, but custom events are better.
As I'm creating QApplication instance in main(), so I have to update in that thread (a.k.a Inside main() or any called functions from main()), but to my orginal problem I have to update some controls continuosly, as the following -
main ()
{
QApplication object;
while (1)
{
//Updation for the controls.
}
object.exec();
}
I assume this algorithm will successfully update controls, but it will be always in while loop and I'll not get any events from the other controls available in the same window. If I'm correct, can anybody suggest a solution for this ? ..thanks in advance ....
Use QTimer to fire a slot at given interval. You don't have to update faster than people can see.
soumyadeep_pan (19th September 2008)
Bookmarks