Results 1 to 3 of 3

Thread: It crashes when using QWebView to show a website

  1. #1
    Join Date
    Apr 2014
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default It crashes when using QWebView to show a website

    I run it on windows 8.1, with Qt 5.1.0, and IDE is Visual Studio 2010 professional.
    Here is the code:

    #include <QApplication>
    #include <QtWebKitWidgets/QWebView>

    int main(int argc, char * argv[])
    {
    QApplication app(argc, argv);

    QWebView view;
    //QCoreApplication::addLibraryPath("./plugins");
    view.settings()->setAttribute(QWebSettings::PluginsEnabled, true);
    // crash
    view.load(QUrl("http://hon.qq.com/act/20140320video/Aluna.html"));
    // OK
    //view.load(QUrl("http://www.youtube.com/watch?v=KMU0tzLwhbE"));
    view.show();

    return app.exec();
    }

    It is OK to show YouTube. It is really weird. I attached the dialog when crash.
    crash.jpg

  2. #2
    Join Date
    Mar 2010
    Posts
    86
    Thanks
    11
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: It crashes when using QWebView to show a website

    it could be so many reasons....
    1. what does your .pro file look like? does it have QT += webkit webkitwidgets network ?
    2. maybe your build didn't do Webkit properly because of ANGLE or OpenGL with Qt/Visual2010
    3. why do you call a QWebView from main? not mainwindow.cpp or dialog.cpp?
    4. maybe you should look at the simple web browser program that is an example code.....

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: It crashes when using QWebView to show a website

    The error dialog clearly indicates the problem is related to dereferencing an uninitialized or otherwise invalid pointer. If you want more meaningful information, run the application under a debugger and provide us with the backtrace.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Filter QWebView to show only selected objects.
    By anupam in forum Qt Programming
    Replies: 2
    Last Post: 24th February 2014, 08:43
  2. problem with QWebView::show()
    By januszmk in forum Newbie
    Replies: 4
    Last Post: 21st July 2012, 11:49
  3. QWebView Crashes APP on Startup
    By harleyskater in forum Qt Programming
    Replies: 7
    Last Post: 6th October 2010, 14:51
  4. Howto select/show a QWebElement in QWebview
    By nightghost in forum Qt Programming
    Replies: 1
    Last Post: 2nd September 2010, 12:51

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.