[PyQt] PyQt5 support for QtWebEngine (for QML WebEngineView)?

Russell Warren russ at perspexis.com
Mon Sep 12 21:38:55 BST 2016


>
> What do you actually want to use which is missing?


All I'm trying to do is get a WebEngineView to render in QML, per their
tiny example here (to start with):

http://doc.qt.io/qt-5/qml-qtwebengine-webengineview.html#initializing-web-engine

(Given that, according to the docs, you don't need to call
> QtWebEngine.initialize()).


Where does it say that? The docs I see [1] say that "*for the web engine
view to be rendered, the web engine must be initialized by using
QtWebEngine::initialize in the application main source file*".

When I convert the small C launcher in the example to python and load the
qml, I get:

QQmlApplicationEngine failed to load component
file:///home/russ/code/qml/examples/WEV.qml:3 module "QtWebEngine" is not
installed

Here is my python file (a direct translation from the cited docs, minus the
unavailable QtWebEngine.initialize()):

#!/usr/bin/env python
import sys
from PyQt5 import QtGui, QtQml
from OpenGL import GL  #Linux workaround.  See: http://goo.gl/s0SkFl

app = QtGui.QGuiApplication(sys.argv)
engine = QtQml.QQmlApplicationEngine()
engine.load("WEV.qml")
app.exec_()

And the QML file...

import QtQuick 2.0
import QtQuick.Window 2.0
import QtWebEngine 1.0

Window {
    width: 1024
    height: 750
    visible: true
    WebEngineView {
        anchors.fill: parent
        url: "http://www.qt.io"
    }
}

I have tried other python launchers (eg: with QQuickView) and I still run
into issues on that qml import of QtWebEngine.


On Fri, Sep 9, 2016 at 12:09 PM, Phil Thompson <phil at riverbankcomputing.com>
wrote:

> On 9 Sep 2016, at 4:19 pm, Russell Warren <russ at perspexis.com> wrote:
> >
> > I'm pretty confident that the answer to my question is that QtWebEngine
> (for qml support) is simply not in the PyQt wheel, even though
> QtWebEngineCore and QtWebEngineWidgets are included. Next step, I think, is
> to successfully build PyQt from scratch to see if it is there.
> >
> > However, while searching for docs to say which specific wrappers/modules
> are included in the wheels (do these exist? I couldn't find it), I noticed
> that "QtWebEngine" is not included in the list of PyQt5 components...
> >
> > http://pyqt.sourceforge.net/Docs/PyQt5/introduction.html#
> pyqt5-components
> >
> > Does this mean there are still no wrappers for it?  Is there a
> fundamental reason for this?  There is a very specific callout for
> QtWebEngineWidgets indicating that there can be compiler issues on Windows,
> but no mention of QtWebEngine is made.
> >
> > Also, assuming it isn't there, is there a list of modules like this that
> don't have PyQt wrappers available?
>
> What do you actually want to use which is missing? (Given that, according
> to the docs, you don't need to call QtWebEngine.initialize()).
>
> Phil




-- 
Russell Warren
Perspexis Technologies Inc.

This information is confidential and intended solely for the use of the
individual or entity to whom it is addressed.
If you have received this email in error, please notify the sender
immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160912/2c23207f/attachment-0001.html>


More information about the PyQt mailing list