DataPlotly icon indicating copy to clipboard operation
DataPlotly copied to clipboard

Moving from deprecated QtWebkit to QtWebengine ?

Open kikislater opened this issue 6 months ago • 14 comments

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

kikislater avatar Jul 03 '25 06:07 kikislater

thanks for reporting! It is already on my todo list

ghtmtt avatar Jul 07 '25 11:07 ghtmtt

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?

ghtmtt avatar Jul 21 '25 13:07 ghtmtt

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 avatar Aug 18 '25 17:08 Smoltbob

@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!

ghtmtt avatar Aug 19 '25 07:08 ghtmtt

@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!

Nice, I didn't realized you have already did it !

kikislater avatar Aug 19 '25 07:08 kikislater

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 avatar Aug 19 '25 13:08 Smoltbob

@Smoltbob I'm on debian, using QGIS from flatpak too, and I've qt6-webengine-dev-tools on the system. Did you have it?

ghtmtt avatar Aug 20 '25 07:08 ghtmtt

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.

Smoltbob avatar Aug 20 '25 08:08 Smoltbob

you can try to import the pyqt classes in the python console of QGIS to make some debug. Maybe it helps!

ghtmtt avatar Aug 20 '25 08:08 ghtmtt

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

Djedouas avatar Sep 23 '25 09:09 Djedouas

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'

Sander50 avatar Nov 26 '25 15:11 Sander50

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

ghtmtt avatar Nov 26 '25 15:11 ghtmtt

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!

Sander50 avatar Nov 26 '25 15:11 Sander50

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.

kikislater avatar Nov 26 '25 16:11 kikislater