"QtWebEngine is not installed" warning even though it is - urgent
Solved
QML and Qt Quick
-
I am developing an application using QML and I need to use WebEngineView to render some webpages.
I need to build it in both Windows and Linux (Ubuntu)In my top-level cmake I fing the package in this way:
set(QT_COMPONENTS Widgets WebEngineQuick Qml Quick Svg Gui Network NetworkAuth LinguistTools PrintSupport Core5Compat ) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS ${QT_COMPONENTS}) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${QT_COMPONENTS}) .... target_link_libraries(${PROJECT_NAME} PRIVATE .... Qt6::Qml Qt6::Quick Qt6::WebEngineQuick ... )
Then in the Main.qml I import and use it
import QtWebEngine .... more code .... WebEngineView { id: webView anchors { top: topContainer.bottom left: leftToolbar.right bottom: bottomBorder.top right: rightBorder.left } settings.localContentCanAccessRemoteUrls: true Component.onCompleted: { console.log("URL:", url) } onCertificateError: function(error) { error.defer() // Display information about the error console.log("Certificate error: " + error.description) console.log("Error type: " + error.type) console.log("URL: " + error.url) if (error.overridable) { error.acceptCertificate() } } }
I have no problems in building it for Windows and in Linux (Debug mode) but I get this warning
[warning] qrc:/Qml/Main.qml:5:1: module "QtWebEngine" is not installed (qrc:/Qml/Main.qml:5)
when trying to build under Linux in Release mode. I installed the QtWebEngine module using the Maintenance tool. I am using Qt 6.8.1. I can also see the lib in the Qt installation lib folder
So I don't understand why in debug mode it detects it and in release mode it's not.
Any help please -
This post is deleted!
-