The Qt Help Framework
-
wrote on 22 Jun 2021, 19:42 last edited by
Can someone tell me if the Qt Help Framework can be used to embed help documents into an QML application or is this for a widgets application?
-
Hi,
AFAIK, the modules was designed for widgets as QML did not exists when it was created however, you can use QHelpEngine or maybe just it's base class to retrieve the help data to show it through something you find suitable.
-
Hi,
AFAIK, the modules was designed for widgets as QML did not exists when it was created however, you can use QHelpEngine or maybe just it's base class to retrieve the help data to show it through something you find suitable.
wrote on 22 Jun 2021, 20:13 last edited by@SGaist Well, I am actually struggling a bit on finding something to display help data in the application. I am using 5.11 and I am basically trying to display an html document or even a pdf document (with working links) in my
QGuiApplication
. Any ideas how I might go about this? I have an open thread: https://forum.qt.io/topic/127799/user-manual -
A combo WebView QHelpEngine might do the trick.
-
wrote on 22 Jun 2021, 20:21 last edited by
@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 ? -
wrote on 22 Jun 2021, 20:47 last edited by CircuitsThis post is deleted!
-
It depends on your target platforms
-
wrote on 22 Jun 2021, 20:58 last edited by CircuitsThis post is deleted!
-
wrote on 22 Jun 2021, 22:01 last edited byThis post is deleted!
-
wrote on 23 Jun 2021, 14:52 last edited by Circuits
@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.
wrote on 23 Jun 2021, 18:24 last edited byThis post is deleted! -
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.
wrote on 23 Jun 2021, 19:41 last edited by Circuits@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 ?
wrote on 23 Jun 2021, 21:20 last edited by@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...
-
wrote on 25 Jun 2021, 17:22 last edited by
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.
wrote on 29 Jun 2021, 15:41 last edited by Circuits@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.
1/21