[Qt-interest] Can Update() be called other than GUI thread

Malyushytsky, Alex alex at wai.com
Wed Jan 20 01:15:26 CET 2010


You can't call update() directly from any thread except gui thread.
This violates requirement that painting must be done in the gui thread.
But other thread may schedule the update by sending event to the GUI thread.

The easiest way to do it is to use using a mechanism called queued connections, it allows to connect signals from one thread to slots in other thread.

Regards,
     Alex



-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of trinathpujari
Sent: Tuesday, January 19, 2010 10:30 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Can Update() be called other than GUI thread

Hi All,

I have multi threaded application which uses QT.

Is it possible to call Update() of QT other than GUI thread i.e
QApplication thread   ?

If i am trying to call Update() from Thread T1 which is not under App
thread, it is not invoking the Paint function i.e Paint(QPainter*
painter, const QStyleOptionGraphicsItem* option, QWidget* widget)

For few times Paint function gets called by calling Update() from some
other thread also i.e T1.

Does QT Supports multi threaded application ?

Please help us in this regard...

Thanks
Naresh




_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."




More information about the Qt-interest-old mailing list