Results 1 to 2 of 2

Thread: print picture (QImage) from non GUI thread

  1. #1
    Join Date
    Oct 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default print picture (QImage) from non GUI thread

    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.

  2. #2
    Join Date
    Apr 2013
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: print picture (QImage) from non GUI thread

    I've got the same problem. Calling m_painter.drawLine instead works fine. So is it because drawImage is using QPixmap somewhere?

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  2. Replies: 10
    Last Post: 20th March 2007, 22:19
  3. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49
  4. [QT4] QThread and printing a QList<QPixmap>
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 21:44

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.