[PyQt] QtWebKit and QtWebKitWidgets
me at the-compiler.org
Mon Sep 15 10:03:04 BST 2014
* Gianluca Romanin <romaninz at gmail.com> [2014-09-15 10:36:50 +0200]:
> I'm using the Qt widget style to build a little Webkit browser.
> I need some Html5 features and I would like to know what version of Webkit
> I'm currently using.
> How I can do it? I can't find lot of infos about the Webkit version used by
You can do this:
from PyQt5.QtWebKit import qWebKitVersion
For me it's 538.1 with Qt 5.3.1.
Also note QtWebKit will be deprecated eventually:
Maybe it would make more sense for you to wait some more weeks for
Qt5.4 and (hopefully) PyQt bindings for QtWebEngine, and then use
Though I think it'll be some more months or even years before QtWebKit
is fully deprecated, but that's only a guess.
> It is not clear to me what are the differences between QtWebKit and
In QtWebKit there are some WebKit related modules which aren't widgets.
Basically the same thing like QtCore and QtWidgets.
>>> for e in dir(QtWebKit):
... if not e.startswith('__'):
> It seems that QtWebKit is used mainly for QML and that wraps a more recent
> version of Webkit: QtWebKit dll is about 18 MB while QtWebKitWidgets dll is
> not even 1MB. If so, how can I use QtWebKit in a QWidget style application
> without QML? Is it possible?
Yes, by importing QtWebKitWidgets instead ;)
A minimal example showing a webpage:
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWebKitWidgets import QWebView
app = QApplication(sys.argv)
wv = QWebView()
By the way: Depending on what you're building exactly, it might make
more sense to join an existing project:
- I'm building a vim-like browser using PyQt and QtWebKit, see
I'd love some contributors, and I'm happy to mentor and help people
along the way.
- Detlev Offenbach is working on the eric IDE which has an
integrated very feature-complete browser, and he told me he's
interested in people helping out with it, and also with turning it
into a standalone application. I think he's reading here as well.
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
GPG 0xFD55A072 | http://the-compiler.org/pubkey.asc
I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 819 bytes
Desc: not available
More information about the PyQt