qhangups icon indicating copy to clipboard operation
qhangups copied to clipboard

Migrate to QWebEngine

Open marczellm opened this issue 8 years ago • 5 comments

Works on my machine, but needs more testing. Scrolling and resizing detection removed, not available with QWebEngine.

marczellm avatar May 11 '16 13:05 marczellm

You can edit .ui files in Designer (part of Qt distribution, or part of PyQt installation on Windows).

Btw. I have tried it with QWebEngine and the result is really awful (too much resource intensive - both RAM and CPU). So I am not considering switch to QWebEngine for now, but QHangups can support both (with QtWebKit used by default if available).

Things that has to be done before merging:

  1. make use of QWebEngine optional (by runtime command line option / settings in app).
  2. fix scrolling / resizing with QWebEngine
  3. use QWebEngine's runJavaScript() to manipulate DOM instead of BeautifulSoup (regenerating HTML and rendering whole page again after every new message is really bad)

It can be done, but I don't have resources (time) to do it myself in near future. But thanks for your preliminary work, it could be useful in future.

xmikos avatar Oct 17 '16 22:10 xmikos

runtime command line option / settings in app

or figure out a way to catch the ImportError and then fall back to QWebEngine?

marczellm avatar Oct 18 '16 08:10 marczellm

That's not a problem, this should be default (if QtWebKit is unavailable, fall back to QWebEngine). But user who has QtWebKit installed should still have option to start QHangups with QWebEngine (at least for testing purposes).

xmikos avatar Oct 18 '16 08:10 xmikos

Btw. scrolling can be implemented with runJavaScript() too. See e.g. this as an example: QtWebEngineWebWidget.cpp

xmikos avatar Oct 18 '16 09:10 xmikos

It seems that whole on_contents_size_changed() (and related scroll_messages()) methods would have to be reimplemented in JavaScript.

xmikos avatar Oct 18 '16 10:10 xmikos