+ Reply to Thread
Results 1 to 5 of 5

Thread: Error Message "QPainter::begin: Paint device returned engine == 0, type: 1"

  1. #1

    Default Error Message "QPainter::begin: Paint device returned engine == 0, type: 1"

    Hello,

    when running my application in Debug mode of VS2008, there is output

    QPainter::begin: Paint device returned engine == 0, type: 1


    In source code, QPainter objects have never called begin(). Could anyone help?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,317
    Thanks
    20
    Thanked 377 Times in 371 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Error Message "QPainter::begin: Paint device returned engine == 0, type: 1"

    In source code, QPainter objects have never called begin().
    begin() is being called by the following constructor:
    http://doc.trolltech.com/4.7/qpainter.html#QPainter-2

    Are you painting in other threads than the main thread?
    Last edited by high_flyer; 24th February 2011 at 10:35.
    Recommended off-line reading:
    The Foundations of Qt Development (ISBN: 1-59059-831-8)

  3. #3

    Default Re: Error Message "QPainter::begin: Paint device returned engine == 0, type: 1"

    Hello,

    I noticed that each time the program execute following line,

    bitBlt( m_Label, QPoint(0,0), &pixmap2 );

    the error message shows in output: "QPainter::begin: Paint device returned engine == 0, type: 1"

    Both m_Label ( a QLabel object) and pixmap2 (a QPixmap object) are valid.

    Is there any suggestion? BTW, I am using QT4.6.

    Thank you,

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,317
    Thanks
    20
    Thanked 377 Times in 371 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Error Message "QPainter::begin: Paint device returned engine == 0, type: 1"

    Is there any suggestion?
    Yes, please answer my question in my previous post.

    Also, the fact you are suing bitBlt() in Qt4.X is a sign for trouble!
    It looks to me you are trying to paint outside a paintEvent() which is a "no no" in Qt4.x
    Recommended off-line reading:
    The Foundations of Qt Development (ISBN: 1-59059-831-8)

  5. #5
    Join Date
    Dec 2009
    Posts
    126
    Thanks
    7
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Error Message "QPainter::begin: Paint device returned engine == 0, type: 1"

    also check if
    Qt Code:
    1. pixmap2.isNull()
    To copy to clipboard, switch view to plain text mode 

+ Reply to Thread

Similar Threads

  1. Replies: 5
    Last Post: 15th December 2010, 03:54
  2. Replies: 5
    Last Post: 20th October 2009, 08:18
  3. Replies: 2
    Last Post: 26th January 2009, 23:03
  4. "Treat wchar_t as Built-in Type" to "yes" link error
    By sungaoyong in forum Qt Programming
    Replies: 1
    Last Post: 5th June 2008, 12:45
  5. paint device returned engine == 0, type: 3
    By MarkoSan in forum Qt Programming
    Replies: 14
    Last Post: 12th December 2007, 11:42

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