[Interest] QPixmap and threads

Jean-Michaël Celerier jeanmichael.celerier at gmail.com
Fri May 5 10:03:33 CEST 2017


> If QPixmaps are forbidden outside the main GUI thread, why is it not
written in the documentation?

http://doc.qt.io/qt-5/thread-basics.html

" All widgets and several related classes, for example QPixmap
<http://doc.qt.io/qt-5/qpixmap.html>, don't work in secondary threads."

Best
Jean-Michaël


On Fri, May 5, 2017 at 9:05 AM, maitai <maitai at virtual-winds.org> wrote:

> Hello,
>
> I have read in many places that QPixmaps should not be used in threads
> (Qt5.8/QtConcurrent in my case).
>
> In fact I have discovered that fact only recently, because I had a random
> crash occurring on QPixmap::load(), and in the end that was occurring when
> QPixmap::load() was used exactly at the same time from different threads.
>
> I changed this part to QImage, OK.
>
> But still, I have hundreds of other QPixmaps used in threads, with no
> problem at all (creating, painting, etc). All is working fine for years,
> without any warning or so from Qt. Should I change also all these QPixmaps
> to QImages (with a conversion cost at the end of the threads)?
>
> If QPixmaps are forbidden outside the main GUI thread, why is it not
> written in the documentation?
>
> Thanks for any lights on this
> Philippe Lelong
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170505/924d7fac/attachment.html>


More information about the Interest mailing list