qhangups icon indicating copy to clipboard operation
qhangups copied to clipboard

Doesn't run on Qt 5.6 in Windows (missing QtWebKit)

Open marczellm opened this issue 8 years ago • 7 comments

Traceback (most recent call last):
  File "D:\Python35\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\Python35\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\Python35\lib\site-packages\qhangups\__main__.py", line 24, in <module
>
    from qhangups.conversations import QHangupsConversations
  File "D:\Python35\lib\site-packages\qhangups\conversations.py", line 3, in <mo
dule>
    from qhangups.conversationwidget import QHangupsConversationWidget
  File "D:\Python35\lib\site-packages\qhangups\conversationwidget.py", line 3, i
n <module>
    from PyQt5 import QtCore, QtGui, QtWidgets, QtWebKitWidgets
ImportError: cannot import name 'QtWebKitWidgets'

QtWebKit was removed from Qt 5.6.

marczellm avatar Apr 11 '16 13:04 marczellm

QtWebKit in Qt 5.6 can still be installed, it is just not included in standard Qt distribution anymore. E.g. in Arch Linux you can install qt5-webkit package.

I can switch to QtWebEngine, but QtWebEngine is much more resource intensive (it eats a lot more memory), which is really not good for simple usecase like displaying messages in IM client :-/

xmikos avatar Apr 15 '16 14:04 xmikos

I'm on Windows where installation / compilation of separate binaries is more complicated. Maybe I'll fork QHangups for my own purpose and try QtWebEngine.

marczellm avatar Apr 15 '16 17:04 marczellm

If you try it with QtWebEngine and it will work without problems, I can merge it back, just do a pull request. I will have to try it myself, because QtWebKit clearly wouldn't be there forever (I just don't have time to do it right now).

xmikos avatar Apr 17 '16 09:04 xmikos

I tried QtWebEngine, but it dropped a lot of APIs including DOM manipulation (I found no clear source on this, but it only seems possible through injected JavaScript), so the migration is nontrivial.

marczellm avatar May 10 '16 22:05 marczellm

I ran this: sudo apt-get install python3-pyqt5.qtwebkit in terminal and now everything works perfectly.

thecodrr avatar May 17 '16 04:05 thecodrr

Unfortunately I cannot do that on Windows.

But I created a pull request with the necessary changes to migrate to QtWebEngine. Unfortunately some APIs were removed, like scrolling or resizing signals.

marczellm avatar May 17 '16 07:05 marczellm

It might be possible on windows to compile Qt with support for QtWebKit. At least on osx from homebrew there is a flag to do so.

pranav-prakash avatar Nov 07 '16 03:11 pranav-prakash