Results 1 to 17 of 17

Thread: Must construct QApplication before QPaintDevice

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Must construct QApplication before QPaintDevice

    I've read a dozen posts on this topic from several forums, and nothing has seemed to help me. My program was running fine, until I switched some functions around from one class to another to cut down on memory waste-age. Now I get

    QWidget: Must construct a QApplication before a QPaintDevice
    I dont think I have any static objects, or at least, I'm not entirely sure what a static object is, so I doubt that I'd inadvertently created one. My main looks like:

    Qt Code:
    1. int main(int argc, char ** argv)
    2. {
    3. QApplication app( argc, argv );
    4. MainWindowImpl win;
    5. win.show();
    6. app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
    7. return app.exec();
    8. }
    To copy to clipboard, switch view to plain text mode 
    So the first thing I do is create a QApplication, but the error message seems to come even before main() is reached. I ran Valgrind, after reading about another person with the same problem.. it returned a lot of information, but I couldnt make much sense of any of it.

    I'd really appreciate some assistance in figuring this out, as this is a problem I've run into several times in the past, and I've always just had to delete portions of code until it started working again, which is a considerable waste of time and effort.

    Thank you for any advice you can give.
    Last edited by jpn; 1st June 2008 at 21:00. Reason: missing [code] tags

Similar Threads

  1. Replies: 16
    Last Post: 12th December 2014, 20:22
  2. Replies: 15
    Last Post: 21st April 2007, 17:46

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.