Results 1 to 3 of 3

Thread: need to draw on pixmaps outside of the gui thread

  1. #1
    Join Date
    Jan 2009
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default need to draw on pixmaps outside of the gui thread

    I need to perform some drawing outside of the main thread (and event loop) and of course I am getting the warning that this can lead to unpredictable behavior.

    Predictably, I occasionally hit an assertion inside Qt.

    I know it's not recommended, but is there a way to lock/synchronize the painting mechanism so that my thread does not interfere with the event loop painting ?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: need to draw on pixmaps outside of the gui thread

    You can draw on QImage in non-GUI thread but not on QPixmap.

  3. #3
    Join Date
    Jan 2009
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: need to draw on pixmaps outside of the gui thread

    True. I wasn't sure if I can initialize the QImage so it matches my display, but it turned out not to be a problem. I can do all my prep work in a worker thread. Dzieki Kolego!

Similar Threads

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

Tags for this Thread

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.