[Interest] QIcons and multithreading

Sensei senseiwa at gmail.com
Fri Apr 5 13:04:07 CEST 2013


On 4/4/13 6:45pm, Alan Ezust wrote:
> The reason, simply, is that the graphics memory and the objects that
> reside in it are not thread-safe, and to make them thread-safe would
> cause a great performance impact, so Qt doesn't try.
> You can read more about this in the documentation, but in general, we
> use QImage instead of QIcon in other threads, and we avoid creating or
> accessing any QWidget from other threads, and instead communicate via
> signals and slots to those objects from other threads. More is written
> about it in the documentation:
>
> http://qt-project.org/doc/qt-4.8/threads-modules.html
>
> You can also read more about it in my chapter on "thread safety and
> QObjects"
>
> http://www.ics.com/designpatterns - login or register first then go to:
> http://www.ics.com/files/designpatterns/book/threadsafety.html


It makes sense now, I'd have provided at least the possibility of having 
GUI-classes thread-safe, but it's not that way.

Thanks!





More information about the Interest mailing list