Results 1 to 5 of 5

Thread: can't new qwebview in a mainwindow constructor

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Oct 2007
    Location
    Grenoble, France
    Posts
    80
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: can't new qwebview in a mainwindow constructor

    Qwidget: must construct a QApplication before a QPaintDevice
    Your answer is here. You have to construct QApplication first.
    Normally your main.cpp should look somehow like that:
    Qt Code:
    1. #include <QtGui/QApplication>
    2.  
    3. #include "mainwindow.h"
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication a(argc, argv);
    8. MainWindow w;
    9. w.show();
    10. return a.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 

    You can try to use QtCreator to start a new project - this code will be generated automatically.

    Next time in your posts please use correct tags (quote, code etc.) and write in a proper forum (this post should be in newbie forum).
    Last edited by calhal; 14th July 2009 at 23:52. Reason: updated contents
    You have to run a level 3 diagnostic.

    Ashes to ashes, Qt to Qt ( wysota )

Similar Threads

  1. Replies: 6
    Last Post: 8th July 2009, 20:28
  2. mainwindow modality
    By user in forum Qt Programming
    Replies: 0
    Last Post: 11th July 2008, 00:54
  3. Notifying Mainwindow of an event..
    By MrGarbage in forum Qt Programming
    Replies: 1
    Last Post: 9th November 2007, 21:29
  4. Replies: 1
    Last Post: 11th September 2007, 13:34
  5. Replies: 3
    Last Post: 23rd July 2006, 18:02

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