Reputation: 111
Well, I was trying to use QWebView. As I learned from the internet, I should, and also this line webkitwidgets
in .pro
file after QT +=
. So I added it and get this error:
Project ERROR: Unknown module(s) in QT: webkitwidgets
I know that a lot of people already asked about this error, but most of the answers were to install libqt5webkit5-dev
using this command line: sudo apt-get install libqt5webkit5-dev
.
The problem is, that I am on Windows, not on Linux, so this can't be useful for me.
The weird thing is, that I have Qt5WebKitWidgets.dll
and Qt5WebKit.dll
in C:\Qt\Tools\QtCreator\bin
, so I suppose, that I have everything I need to use QWebView and to add this line QT += webkitwidgets
without getting any errors.
Also, I learned that WebKitWidgets is no longer supported after QT 5.0 and newer(or something like that), and I should use QtWebEngine, but I don't understand how to use it in Qt Widgets Application with QWebView.
Upvotes: 3
Views: 9363
Reputation: 161
The weird thing is, that I have Qt5WebKitWidgets.dll and Qt5WebKit.dll in C:\Qt\Tools\QtCreator\bin, so I suppose, that I have everything I need to use QWebView and to add this line QT += webkitwidgets without getting any errors.
Thats because windows dlls must be on the path or on the base path of the app, is just the way of windows of doing things. You can see that if you install qtcreator on windows, the app will be without dlls on the lib folder. Everything will be on the bin folder
Upvotes: 0
Reputation: 3318
Similar to Kuba Ober's answer, I got it to work by copying the webkit and webkitwidgets pri files from a previous installation, 5.5.
~/Qt/5.5/clang_64/mkspecs/modules/
Upvotes: 0
Reputation: 98425
You're mixing up Qt Creator (an IDE) and Qt — the development toolkit itself. It absolutely doesn't matter what's bundled with Qt Creator — whatever is there is used solely by Qt Creator since it is also built using Qt.
You need to look in your Qt's installation directory, under mkspecs/modules
. Each module has a .pri
file. You should see both qt_lib_webkit.pri
and qt_lib_webkitwidgets.pri
. If you don't, that would mean that the modules weren't built for the Qt that you're using. The modules folder is where qmake
looks for Qt module definitions.
If you're using a prebuilt recent version of Qt, it's likely that it is built with WebKit turned off. The workaround would be to go to a previous minor version (say 5.4 instead of 5.5), or to build Qt yourself.
Upvotes: 3