The Qt Help Framework
-
@SGaist Which is where my head was going but I am not sure how to set it up. When I try to import QtWebView 1.1 I get a QML module not found error. I can #include <QHelpEngine> with QT += help. I am not sure how to get the QtWebView 1.1 module to load in QML. I have never had this problem before so I am not sure if there is something I need to add to our make file or what..
-
Did you add
QT += webview
to your .pro file ? -
It depends on your target platforms
-
@SGaist Alright, so I can now get the
QtWebView 1.1
module to import with no errors. However, I am getting a:"No WebView plug-in found!"
error when I try to view the page.
The steps I have taken:
- load the library's into the build
#include <QHelpEngine>
, and#include <QtWebView>
in main .cpp- add
QtWebView::initialize();
afterQGuiApplication app(argc, argv);
- added
QT += webview
to my .pro - added
QT += help
to my .pro
I added the html file as a resource file and created the following WebView:
WebView { anchors.fill: parent url: "qrc:/Assets/Images/test.html" }
There must be something I am missing? Is it not enough to just include the
QHelpEngine
or do I need to load the html file using theQHelpEngine
somehow? -
If you are targeting Linux or Windows, you also need the webengine module as these two systems do not have a native web component like macOS, iOS or Android.
-
If you are targeting Linux or Windows, you also need the webengine module as these two systems do not have a native web component like macOS, iOS or Android.
-
If you are targeting Linux or Windows, you also need the webengine module as these two systems do not have a native web component like macOS, iOS or Android.
@SGaist Alright, I included the module but I can't seem to find the correct import i.e:
main.cpp:59:5: error: use of undeclared identifier 'QtWebEngine'
where line 59 is:QtWebEngine::initialize();
I tried:#include <QtWebEngine>
but the file isn't being found. -
AFAIK, you should not need to do anything special with regard to webengine since it's a dependency of QtWebView.
How did you install both ?
-
AFAIK, you should not need to do anything special with regard to webengine since it's a dependency of QtWebView.
How did you install both ?
@SGaist Well there were inclusions in our makefile for them:
QT_CONFIG_OPTIONS += -skip qtwebengine QT_CONFIG_OPTIONS += -skip qtwebview
so I simply deleted those lines and rebuilt the platform. This allowed me to add
#include <QtWebView>
and
QtWebView::initialize();
to main.cpp. It also allowed me to:
import QtWebView 1.1
s/t I could initialize a
WebView{}
component in QML. So originally, I did not delete the:QT_CONFIG_OPTIONS += -skip qtwebengine
line from the make file and I was getting the error: "No WebView plug-in found!"
when trying to view theWebView
in the application. I tried deleting that line and viewing theWebView
again and I still go the error. So then I looked here and here which seemed to suggjest that I would need to add:QT += webengine
to my .pro file and add:
QtWebEngine::initialize();
to main.cpp before this would work but perhaps I have confused myself? Wouldn't' be the first time...
-
Well, I still haven't managed to properly include the qtwebengine module. I have tried:
QT_CONFIG_OPTIONS += -qtwebengine
I have also (as I noted in the post above) just tried removing the 'skip' inclusion (worked for webview) but I can't seem to get the build to include the webengine. Essentially, I need to firgure out what goes here:
QT_CONFIG_OPTIONS += ???
for instance, some of the builds other includes look like this:
QT_CONFIG_OPTIONS += -commercial QT_CONFIG_OPTIONS += -confirm-license QT_CONFIG_OPTIONS += -debug QT_CONFIG_OPTIONS += -c++std c++14 QT_CONFIG_OPTIONS += -opengl desktop QT_CONFIG_OPTIONS += -system-xcb
as I noted above simply removing this line
QT_CONFIG_OPTIONS += -skip qtwebengine
doesn't work like it did for the webview.
-
What is your target ?
You seem to build Qt yourself.
I would first make it work using the pre-built binaries if possible and only then build your custom Qt version.
-
What is your target ?
You seem to build Qt yourself.
I would first make it work using the pre-built binaries if possible and only then build your custom Qt version.
@SGaist Yes I am building Qt myself and yes I should have done that from the beginning; however, I am already deep enough now that I don't mind finishing out this way.
Based on this document I should be able to see all available modules (features) by using the
-list-features
command. Doing that leads to the following "webengine" related features being listed:webengine-embedded-build . WebEngine: Enables the embedded build configuration. webengine-native-spellchecker . WebEngine: Use the system's native spellchecking engine. webengine-pepper-plugins . WebEngine: Enables use of Pepper Flash and Widevine plugins. webengine-printing-and-pdf . WebEngine: Provides printing and output to PDF. webengine-proprietary-codecs . WebEngine: Enables the use of proprietary codecs such as h.264/h.265 and MP3. webengine-spellchecker .. WebEngine: Provides a spellchecker. webengine-v8-snapshot ... Enables the v8 snapshot, for fast v8 context creation webengine-webrtc ........ WebEngine: Provides WebRTC support.
This leads me to wonder what the differences are between the webengine seen here and the embedded webengine-embedded-build module is or if they are the same thing.
The only documentation I can find on building the module from source is here but I am not sure if it's talking about this "webengine-embedded-build" or if their is some other, similarly named, module that's not showing up in the list.
My guess is that if I were to meet the dependencies laid out in that page then perhaps compiling the "webengine-embedded-build" would allow me to
QT += webengine
andimport QtWebEngine 1.0
but I am not positive. -
Sorry, I do not know the particularities of the embedded build.