[Qt-interest] QPainter: It is not safe to use drawPixmap() outside the GUI thread
Mihail Naydenov
mlists at ymail.com
Wed Oct 28 14:19:58 CET 2009
----- Original Message ----
> From: Serge <mb0 at km.ru>
> To: qt-interest at trolltech.com
> Sent: Wed, October 28, 2009 1:36:59 PM
> Subject: [Qt-interest] QPainter: It is not safe to use drawPixmap() outside the GUI thread
>
> Hello,
>
> I have QT application, which renders SVG on QPixmap in a separate
> thread. Separate thread is needed because rendering takes a lot of time.
> this application was developed in QT 4.3.3
> it worked fine without warnings.
>
> now i built it in QT 4.5.2
> when it works in debug output window i can see a lot of messages:
> QPainter: It is not safe to use drawPixmap() outside the GUI thread
>
> Is it critical warning?
> Can i leave rendering the same or i need to rewrite rendering so that it
> would not use QPixmap? What thread-safe alternative of using QPixmap?
You should use QImage instead.
Than you can drawImage() or QPixmap::fromImage() if you really need a pixmap (faster onscreen)
MihailNaydenov
>
> Thank you!
>
> --
> Serge
> _______________________________________________
> 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