Results 1 to 2 of 2

Thread: why"QPixmap: Must construct a Qapplication before a QpaintDevice" only in Debug mode?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2008
    Posts
    68

    Default why"QPixmap: Must construct a Qapplication before a QpaintDevice" only in Debug mode?

    Hello,

    I upgraded my application from Qt3.3 to Qt4.4. I have the following problem when the Qt4.4 program is running.

    - In release mode, it works fine;;

    - In debug mode, compilation and link is ok. However, when it runs, it pops up a error message:

    QPixmap: Must construct a Qapplication before a QpaintDevice.

    Following is the code in my main program and the error happened at :
    MainWindow smw;

    But I create QApplication before it already!

    - also, the release version can work ...

    Can anyone help me why this happened and how to solve it?

    thank you very much!




    Qt Code:
    1. int main( int argc, char ** argv )
    2. {
    3. try
    4. {
    5.  
    6. QApplication app( argc, argv );
    7.  
    8. MainWindow smw;
    9. app.setMainWidget( &smw );
    10. smw.hide();
    11.  
    12. ...
    13. }
    14. ...
    15. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 8th January 2009 at 13:33. Reason: missing [code] tags

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
  •  
Qt is a trademark of The Qt Company.