Results 1 to 3 of 3

Thread: Static with domtraversal example gives QApplication before QPaintDevice error

  1. #1
    Join Date
    Sep 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Static with domtraversal example gives QApplication before QPaintDevice error

    I am using QtCreator 2.3.1 (based on Qt 4.7.4). I downloaded Qt libraries 4.8.3 for Windows (VS 2010, 235 MB) and built for static linking, configured by:

    configure -debug-and-release -opensource -static -platform win32-mscvc2010

    I want to be able to make static executables. I modified my QTCreator build to use this version of the libraries. I tried a couple of the examples, calculatorform and simpletreemodel worked fine, ran locally and when transferred to another system that doesn't have Qt installed. However I wanted to use the domtraversal example and this even fails to run locally in QtCreator giving the following error:

    domtraversal_error.jpg

    Any help would be appreciated? Do I need to make something else correctly for this to work?

    Cheers

    Steve

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Static with domtraversal example gives QApplication before QPaintDevice error

    Have you actually stepped into main() with the debugger to see where this error occurs?

  3. #3
    Join Date
    Sep 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static with domtraversal example gives QApplication before QPaintDevice error

    I hadn't as the error seemed fairly explicit in that sense. Have now. The final call from the example is the last line in the following code:

    Qt Code:
    1. void setupUi(QMainWindow *Window)
    2. {
    3. if (Window->objectName().isEmpty())
    4. Window->setObjectName(QString::fromUtf8("Window"));
    5. Window->resize(800, 600);
    6. centralwidget = new QWidget(Window);
    7. centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
    8. verticalLayout_2 = new QVBoxLayout(centralwidget);
    9. verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
    10. verticalLayout_2->setContentsMargins(-1, 4, -1, 4);
    11. webView = new QWebView(centralwidget);
    To copy to clipboard, switch view to plain text mode 

    Step into doesn't seem to work at that point.

    A QApplication has been constructed in main before the above code:

    Qt Code:
    1. QApplication app(argc, argv);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 16
    Last Post: 12th December 2014, 20:22
  2. Replies: 42
    Last Post: 25th July 2012, 21:39
  3. Replies: 4
    Last Post: 27th December 2011, 11:34
  4. Replies: 2
    Last Post: 25th July 2011, 08:08
  5. Must construct QApplication before QPaintDevice
    By sekatsim in forum Qt Programming
    Replies: 16
    Last Post: 8th June 2008, 00:00

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.