Re: need help in QThread()
Fortune server is a networking example. What about the actual threading examples, have you checked them? Did you search the forum for QThread?
Re: need help in QThread()
thanks for reply
i need some code to work on the gui part ..
ex:
if the user clicks a button the text of the QLable should change its text which i should run that slot for changing text in another parallel thread so i am searching something which run timely changing the GUI appearance ...
i searched for that in this forum but cant get any example like that ...because i am new to Qt field
i went through fortuneserver but its not updates or repaints the widgets so only i ask for experts
please help me .. just send me any suitable link :)
Re: need help in QThread()
Quote:
Originally Posted by
wagmare
i need some code to work on the gui part ..
Ok, before we start. Do NOT touch GUI in a worker thread. From Qt docs: "Although QObject is reentrant, the GUI classes, notably QWidget and all its subclasses, are not reentrant. They can only be used from the main thread."
You can do some expensive calculation in worker threads, but you must deliver the results to the GUI thread where you can change the GUI to reflect the results. You can use signals and slots or custom events to deliver calculated results to the main GUI thread. Or perhaps you could even use the higher level threading API of Qt Concurrent.