[Interest] Setting an QObjects dynamic property from another thread

Bo Thorsen bthorsen at ics.com
Thu Jan 30 17:04:17 CET 2014


Hi Phillip,

No, across threads you have to use postEvent. sendEvent delivers the 
event directly to the receiver eventHandler, so you would have the 
eventHandler running from another thread.

http://qt-project.org/doc/qt-5.0/qtcore/qcoreapplication.html#postEvent

Bo.

Den 30-01-2014 16:51, Philipp Kursawe skrev:
> Such operation should be possible, yet it fails cause setProperty calls:
>
> QDynamicPropertyChangeEvent ev(name);
> QCoreApplication::sendEvent(this, &ev);
>
> sendEvent cannot be called from another thread the object does not
> belong to. Is this a bug? Shouldn't that be postEvent instead?
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>


-- 
Bo Thorsen, European Engineering Manager, ICS
Integrated Computer Solutions. Delivering World-Class Applications
http://ics.com/services



More information about the Interest mailing list