Results 1 to 6 of 6

Thread: Using QtCreator and QT5 on Windows and "QWebView: no such file or directory" issue

  1. #1

    Default Using QtCreator and QT5 on Windows and "QWebView: no such file or directory" issue

    I'm trying to use QtCreator and QT5 on Windows to create a very basic QWebView. However no matter what I do I cannot get past the error: "QWebView: No such file or directory". I've googled this issue, I've added += webkit to my pro file, and I've tried cleaning and running qmake a number of time but nothing works. Am including contents of my .cpp and .pro file in case I'm doing something wrong somebody can point out -- the code is something I found on the web, and the .pro is mostly boilerplater created by QtCreator. Thanks in advance.

    Qt Code:
    1. #include <QtGui>
    2. #include <QWebView>
    3.  
    4. int main(int argc, char** argv) {
    5.  
    6. QApplication app(argc, argv);
    7.  
    8. QWebView* view = new QWebView;
    9. view->setUrl(QUrl("http://localhost"));
    10. view->show();
    11.  
    12. return app.exec();
    13. }
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. QT += core gui webkit
    2.  
    3. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    4.  
    5. TARGET = QWebViewGuiTest
    6. TEMPLATE = app
    7.  
    8. SOURCES += main.cpp
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,688
    Thanks
    13
    Thanked 1,598 Times in 1,526 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Using QtCreator and QT5 on Windows and "QWebView: no such file or directory" issu

    You need:
    Qt Code:
    1. QT += qtwebkitwidgets
    To copy to clipboard, switch view to plain text mode 
    http://qt-project.org/doc/qt-5.0/qtw...it-module.html

  3. #3

    Default Re: Using QtCreator and QT5 on Windows and "QWebView: no such file or directory" issu

    Quote Originally Posted by ChrisW67 View Post
    You need:
    Qt Code:
    1. QT += qtwebkitwidgets
    To copy to clipboard, switch view to plain text mode 
    http://qt-project.org/doc/qt-5.0/qtw...it-module.html
    I will take a longer look at the URL you provided later today but I tried adding what you suggested to my .pro file and now get this error running qmake:

    "Unknown module(s) in QT: qtwebkitwidgets"

  4. #4
    Join Date
    Mar 2013
    Location
    Slovakia
    Posts
    9
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Using QtCreator and QT5 on Windows and "QWebView: no such file or directory" issu

    Try this
    Qt Code:
    1. QT += webkitwidgets
    To copy to clipboard, switch view to plain text mode 
    http://qt-project.org/doc/qt-5.0/qtw...ets-index.html

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,688
    Thanks
    13
    Thanked 1,598 Times in 1,526 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Using QtCreator and QT5 on Windows and "QWebView: no such file or directory" issu

    Yes, my bad.

  6. #6

    Default Re: Using QtCreator and QT5 on Windows and "QWebView: no such file or directory" issu

    QT += webkitwidgets worked, thanks very much!

Similar Threads

  1. Replies: 12
    Last Post: 19th August 2015, 19:50
  2. Replies: 2
    Last Post: 14th November 2010, 12:14
  3. Replies: 4
    Last Post: 26th July 2010, 08:02
  4. Replies: 2
    Last Post: 23rd June 2010, 23:00
  5. Replies: 1
    Last Post: 23rd June 2010, 07:03

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.