Qt-interest Archive, January 2008
sendPostedEvents: Cannot send posted events
Message 1 in thread
Hi Everybody,
What does message below mean:
QCoreApplication::sendPostedEvents: Cannot send posted events for
objects in another thread
I created QTableWidget in one thread and call col(n)->setText(...) in
another one. What is the right way to do it?
PS:
Application I talk about is simple auto-update tool -
it walks through filelist and download file if it is missed or has wrong
md5. The only GUI I need is something very close to Mozilla or Opera
downloader window.
I'm new in QT, so any comments will kindly be appreciated.
All sources are here:
http://devnull.samersoff.net/cgi-bin/hg/hgwebdir.cgi/updater/file/22bcaf890129/
--
[ signature omitted ]
Message 2 in thread
On 28.01.08 01:17:49, Dmitry Samersoff wrote:
> What does message below mean:
>
> QCoreApplication::sendPostedEvents: Cannot send posted events for objects
> in another thread
>
>
> I created QTableWidget in one thread and call col(n)->setText(...) in
> another one. What is the right way to do it?
You need to send a queued signal from your thread to the main/gui thread
and then do the col(n)->setText() there. You can't use setText directly
from a non-gui-thread as apparently that schedules a paint event which
needs to be done from the gui thread.
Thats what the message tells you.
Andreas
--
[ signature omitted ]
Message 3 in thread
Andreas,
Andreas Pakulat wrote:
> On 28.01.08 01:17:49, Dmitry Samersoff wrote:
>> What does message below mean:
>>
>> QCoreApplication::sendPostedEvents: Cannot send posted events for objects
>> in another thread
>>
>>
>> I created QTableWidget in one thread and call col(n)->setText(...) in
>> another one. What is the right way to do it?
>
> You need to send a queued signal from your thread to the main/gui thread
> and then do the col(n)->setText() there. You can't use setText directly
> from a non-gui-thread as apparently that schedules a paint event which
> needs to be done from the gui thread.
>
> Thats what the message tells you.
Thank you. Do you have an example how to change QTableWidgetItem text
async ?
--
[ signature omitted ]