webenginewidgets on .pro of library produce error
-
I have created a project using QWebEngine and would want to convert it as a library (Shared Library) so that it can be integrate to any project. To test it, I created a subdir project first, then a library which will use qwebengine and a console project that will manage the library to run.
On .pro of the library and console project, I assume it is needed to include QT += core gui webenginewidgets, but I keep getting errors about qwebenginewidgets. I need qwebenginewidgets to be able to use qwebengine classes like QWebEngineView. How am I going to fix this?
-
@LovelyGrace said in webenginewidgets on .pro of library produce error:
but I keep getting errors about qwebenginewidgets
when compiling your lib or the project using your lib?
And what errors are those? -
I am getting :-1: error: [sub-WebLogin-qmake_all] Error 3 or unknown: webenginewidgets, something like that.
I wonder if it's because of the kit? does webenginewidgets only works at qt 5.9+ version?
-
And is it because of the msvc version?
-
Hi,
What version of Qt are you using ?
What compiler are you using ?Yes, QtWebEngine has more drastic restrictions with regards to compilers because of Chromium that it uses internally. So depending on the Qt version you are currently using, you would need to have either MSVC2015 (pre-Qt 5.12) or MSVC2017 (starting with Qt5.12).
-
I am using msvc 2015 and 2017 Qt 5.9.6 and it works as console project. Why isn't it working as library?
How about mingw?
-
It shouldn't make any difference.
Can you show both the console and library .pro files ?
-
now i'm getting error from the subdir project C1083: Cannot open include file: 'QWebEngineView': No such file or directory when I tried to include QWebengine classes
This is the library.pro
QT += webenginewidgets
QT += webchannel websockets network
QT += core guiCONFIG += c++11 console
CONFIG -= app_bundleTARGET = WebLogin
TEMPLATE = libDEFINES += WEBLOGIN_LIBRARY
DEFINES += QT_DEPRECATED_WARNINGSSOURCES +=
weblogin.cpp
Encryption/qblowfish.cpp
WebSocket/websocketclientwrapper.cpp
WebSocket/websockettransport.cppHEADERS +=
weblogin.h
weblogin_global.h \
Encryption/qblowfish.h
Encryption/qblowfish_p.h
WebSocket/websocketclientwrapper.h
WebSocket/websockettransport.hunix {
target.path = /usr/lib
INSTALLS += target
}and the console.pro
QT -= guiCONFIG += c++11 console
CONFIG -= app_bundleDEFINES += QT_DEPRECATED_WARNINGS
SOURCES +=
main.cppwin32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../WebLogin/release/ -lWebLogin
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../WebLogin/debug/ -lWebLogin
else:unix: LIBS += -L$$OUT_PWD/../WebLogin/ -lWebLoginINCLUDEPATH += $$PWD/../WebLogin
DEPENDPATH += $$PWD/../WebLoginand the sub dir.pro
QT += webenginewidgets
QT += webchannel websockets network
QT += core guiTEMPLATE = subdirs
SUBDIRS +=
WebLogin
ManageLoginWhen I tried to build the library only, it doesn;t produce the error, but when I am trying to build the whole project from sub dir project including the library and the console, it produce the error
I am only using kit msvc 2015 and 2017 Qt 5.9.6
-
This post is deleted!
-
@LovelyGrace said in webenginewidgets on .pro of library produce error:
but when I am trying to build the whole project from sub dir project including the library and the console, it produce the error
You need to add Qt += webenginewidgets to your console project as well.