Unable to run Qt WebView sample code
-
Hello,
I have built and installed QtWebKit and QtWebView from source https://code.qt.io/cgit/ at tag 5.12.5.
I have built the sample projectminibrowser.pro.
When I run the project, it says :No WebView plug-in found!
I'm running Ubuntu 19.04 and using Qt5.12.5.
The WebView libraries are installed in <QT_INSTALL_DIR>/lib
Plugins loaded: libqwbmp, libqwebp.
Another message says:On QtCore unload, "/usr/local/Qt-5.12.5/qml/QtWebView/libdeclarative_webview.so" was leaked, with 2 users
Any help would be precious ;)
-
Getting the same error ("No WebView plug-in found!) when trying to run the minibrowser sample with
Qt 6.3.1
macOS 11.6.7
XCode 13.2.1It really would be useful to have a minimal Qt WebView example actually working!
UPDATE: I found a workaround on macOS - set the following environment variable in the Run environment:
QT_WEBVIEW_PLUGIN=native
However this hasn't worked on Linux, where the setting (I think) would be:
QT_WEBVIEW_PLUGIN=webengine
None of this is mentioned anywhere in Qt6 docs for WebView as far as I know. I had to read the source at
https://code.qt.io/cgit/qt/qtwebview.git/tree/src/webview/qwebviewfactory.cpp?h=6.3.1
to find that out. And the source code itself is not clear - the comments there suggest that thenative
web runtime is not used on macOS.
Which is the opposite of what the docs suggest: https://doc.qt.io/qt-6/qtwebview-index.html - "On macOS, the system web view is used in the same manner as iOS."Does anybody at Qt care to comment on this? The lack of working examples and clear documentation on this make it seem like the whole WebView is deprecated or unmaintained.