Moving from deprecated QtWebkit to QtWebengine ?
Describe the solution you'd like QtWebkit as been deprecated in 2020 for security and vulnerability reasons. QtWebEngine is the officially supported web rendering module for Qt Moving to QtWebengine will allow:
- Strong security posture and long-term support.
- Continued compatibility with current and future Qt versions.
Describe alternatives you've considered Moving to QtWebEngine if possible as recommended by Qt
Additional context https://github.com/qtwebkit/qtwebkit/releases/tag/qtwebkit-5.212.0-alpha4
thanks for reporting! It is already on my todo list
not 100% sure but on this branch you can find an alpha version compatible with Qt6 and that uses QtWebengine instead of QtWebkit. I made some tests also for the plot interaction and it seems working. Are you able to test it?
Hi! Thank you for working on this! I'd be happy to test, however I have no idea how I can package the plugin from source. Is there a guide I can follow ? (I'm interested in this issue as the flatpak version of QGIS is not packaged with PyQt5.QtWebKit and thus the plugin cannot be installed.)
@Smoltbob you can go the code main page and switch to the branch https://github.com/ghtmtt/DataPlotly/tree/webengine_qt6. The you can click on Code -> Download ZIP (github should automatically download the zip of the correct branch) and you have the entire repository on your computer.
The nested DataPlotly folder is the one that has to be added to the QGIS profile folder. You can zip it and in QGIS install the plugin from zip. Let me know if you need more information.
Looking for you feedback!
@Smoltbob you can go the code main page and switch to the branch https://github.com/ghtmtt/DataPlotly/tree/webengine_qt6. The you can click on
Code -> Download ZIP(github should automatically download the zip of the correct branch) and you have the entire repository on your computer.The nested
DataPlotlyfolder is the one that has to be added to the QGIS profile folder. You can zip it and in QGIS install the plugin from zip. Let me know if you need more information.Looking for you feedback!
Nice, I didn't realized you have already did it !
Thanks a lot @ghtmtt , I had no idea it was that easy. Unfortunately the zip installation failed with the following error
Couldn't load plugin 'DataPlotly' due to an error when calling its classFactory() method ImportError: cannot import name 'QWebEngineSettings' from 'qgis.PyQt.QtWebEngineCore' (/app/share/qgis/python/qgis/PyQt/QtWebEngineCore.py)
I think it's an issue with my install of QGIS, it's installed on Fedora from flathub and thus may not have all the expected packages available.
Edit: I tried with an install from rpm, and get the same issue.
@Smoltbob I'm on debian, using QGIS from flatpak too, and I've qt6-webengine-dev-tools on the system. Did you have it?
I did not, but I tried by installing qt6-qtwebengine-devel and get the same error.
ImportError: cannot import name 'QWebEngineSettings' from 'qgis.PyQt.QtWebEngineCore' (/usr/lib64/python3.14/site-packages/qgis/PyQt/QtWebEngineCore.py)
(The python path is different because I tried in a toolbx container). I feel like QGIS is using the wrong qt version somehow ? I'll try to look closer at how to make sure my paths are correct.
you can try to import the pyqt classes in the python console of QGIS to make some debug. Maybe it helps!
Hi,
I had the same import error on Ubuntu plucky 25.04, and fixed it by installing the following packages
python3-pyqt6.qtwebengine
python3-pyqt6.qtwebchannel
Any updates on this? DataPlotly currently also does not run on Manjaro, it displays this error: Couldn't load plugin 'DataPlotly' due to an error when calling its classFactory() method ModuleNotFoundError: No module named 'PyQt5.QtWebKit'
migration to qt6 (qtwebengine) is on the way. Very likely your installation of QGIS is missing the QtWebKit module and you need to install it manually
Thanks for the update! On Manjaro I think this would require compiling packages like qt5-webkit myself, so I'll wait for the Qt6/QtWebEngine migration instead, I'm not in a hurry. Thanks!
Hi, I'm on manjaro too ... For qt5-webkit from aur, you have a precompiled package in arch4edu repository. You can add this repo to your pacman.conf but even with that it will not work, you need to recompile qgis with package installed.