PDA

View Full Version : print picture (QImage) from non GUI thread



valeron
13th October 2008, 08:24
Hi!
It is necessary to make printing of pictures in the thread (non GUI).
QImage image;
QPainter m_painter;
...

m_painter.drawImage(0, 0, image, 0, 0, -1, -1, Qt::MonoOnly | Qt::ThresholdDither | Qt::ThresholdAlphaDither);

After function call drawImage I receive the message:
QPixmap: It is not safe to use pixmaps outside the GUI thread.

Thus the printer prints a blank page.

Does somebody know how to solve this?
Thanks for any help.

maryv
30th April 2013, 20:35
I've got the same problem. Calling m_painter.drawLine instead works fine. So is it because drawImage is using QPixmap somewhere?