[Qt-interest] QtConcurrent::run results in random crashes

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Wed Jul 28 06:44:07 CEST 2010


> Thanks for that, I really didn't know that using QPixmap outside the
> Main/GUI thread is a problem. I will do the scaling of my thumbnails

I had a similar problem (of app crashing when trying to create a
QPixmap in a console app).

You will  need an instance of "QApplication" for using QPixmaps since
it initializes the underlying OS's graphics subsystem, which will be
there in your main GUI thread. Once that is done, I "think" it should
be safe to use QPixmaps in another thread as well.

If you're NOT going to do any pixel manipulation of your images and
instead only want to paint them (after scaling) then I guess it's
better to use QPixmaps than QImage.

HTH,
-mandeep


> with QImage, I guess this should be thread safe at least if only one
> thread at a time uses the same Image.
> Is the conversion from QImage to QPixmap very expensive, if I use a
> QImage whith the same Format as the Pixmap on the current system lets
> say RGB32 on non transparent widgets and ARGB32Premultiplied on
> transparent ones ?
>
> Justus
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>



More information about the Qt-interest-old mailing list