MeVisLab / pythonqt

Dynamic Python binding for Qt Applications
https://mevislab.github.io/pythonqt/
GNU Lesser General Public License v2.1
251 stars 89 forks source link

Please remove the dependency on QWebKit because it is deprecated #141

Open yurivict opened 1 year ago

yurivict commented 1 year ago

pythonqt-3.4.2 has dependency on QWebKit:

$ grep -ri webkit work/pythonqt-3.4.2/
work/pythonqt-3.4.2/extensions/PythonQt_QtAll/PythonQt_QtAll.cpp:#ifdef PYTHONQT_WITH_WEBKIT
work/pythonqt-3.4.2/extensions/PythonQt_QtAll/PythonQt_QtAll.cpp:void PythonQt_init_QtWebKit(PyObject*);
work/pythonqt-3.4.2/extensions/PythonQt_QtAll/PythonQt_QtAll.cpp:#ifdef PYTHONQT_WITH_WEBKIT
work/pythonqt-3.4.2/extensions/PythonQt_QtAll/PythonQt_QtAll.cpp:    PythonQt_init_QtWebKit(0);
work/pythonqt-3.4.2/extensions/PythonQt_QtAll/PythonQt_QtAll.pro:  qtHaveModule(webkit):CONFIG += PythonQtWebKit
work/pythonqt-3.4.2/extensions/PythonQt_QtAll/PythonQt_QtAll.pro:PythonQtWebKit {
work/pythonqt-3.4.2/extensions/PythonQt_QtAll/PythonQt_QtAll.pro:  DEFINES += PYTHONQT_WITH_WEBKIT
work/pythonqt-3.4.2/extensions/PythonQt_QtAll/PythonQt_QtAll.pro:  Xinclude (com_trolltech_qt_webkit)
work/pythonqt-3.4.2/extensions/PythonQt_QtAll/PythonQt_QtAll.pro:  QT += webkit webkitwidgets

QWebEngine is a replacement.

Thanks! Yuri

mrbean-bremen commented 1 year ago

It is true that WebKit is deprecated, nethertheless it is still maintained (outside of Qt), and at least some people rely on it. The define PYTHONQT_WITH_WEBKIT is there to allow to include/exclude it. To make this better configurable, it could for example be made dependent on an environment variable, but given that you have to build PythonQt yourself anyway, you could just remove that define in your build environment.

yurivict commented 1 year ago

There are also qmake arguments, you can add an argument DISABLE_WEBKIT=yes. This would be better than patching.

mrbean-bremen commented 1 year ago

you can add an argument DISABLE_WEBKIT=yes.

True. Do you want to make a PR?

yurivict commented 1 year ago

Sorry, I don't have resources for PRs. I am only a port maintainer.


On a side note: QWebEngine doesn't seem to be supported in pythonqt.

mrbean-bremen commented 1 year ago

No problem, it just means that it may take some time.

As for WebEngine - @usiems, do you want to comment?

he-hesce commented 1 year ago

Thanks @mrbean-bremen . Indeed, we are users of QtWebKit as it has features still not yet implemented in its "replacement" QtWebEngine. QtWebKit is maintained by the original developer but outside the Qt company. This third-party QtWebKit ships with RHEL 7/8/9 and Ubuntu 20.04/22.04 which uses Qt after 5.6 after which it was removed.

It would actually be great that any pre-created files from the generator would actually ship with QtWebKit stuff. We are currently still using 5.6 generator files with Qt 5.12/5.15 as that directory has QtWebKit files.

And on a somewhat related note to what goes on elsewhere here with the generator. It's good to see Qt 5 support still honored. Given that RHEL 9 ships with Qt 5.15, we are many production users which will be on Qt 5.15 until at least 2032.

usiems commented 1 year ago

On a side note: QWebEngine doesn't seem to be supported in pythonqt.

There is a typesystem_webenginewidgets.xml file (which also contains the QtWebEngine classes) in the generator now, but it seems the generated sources were never updated in the repository. We have generated the wrappers for MeVisLab.

mrbean-bremen commented 1 year ago

There is currently an ongoing effort to recreate the wrappers (see #140), so this probably be remediated soon.