[Eric] R: QWebEngineView in QtDesigner

umbertofilippo at tiscali.it umbertofilippo at tiscali.it
Tue Oct 31 08:56:31 GMT 2017


Dear all,

 

All file names written in this message refers to the already mentioned Jaime
Seuma <http://eric-ide.python-projects.org/tutorials/MiniBrowser/> ’s
tutorial.  

I found the problem.

Apparently, it was not a matter of missing import in the project.

QWebEngineWidgets module was there, and there was a variable called “widget”
in my Ui_MainWindow.py (generated from the .ui file with pyuic5), which was
equal to “QtWebEngineWidgets.QWebEngineView(self.centralWidget)”.

 

So I had to reflect this in my “on_btnNavigate_released()” method.

Now my working code (mainwindow.py) looks like (only on_btnNavigate_released
part):

 

@pyqtSlot()

    def on_btnNavigate_released(self):

        """

        Public slot invoked when the user clicks the Navigate Button .

        """

        self.widget.setUrl(QUrl(self.txtUrl.text()))

 

Hope this will be of help.

I really thank Jaime for taking the time back in the years to making the
tutorial!

 

Cheers,

 

 

Da: umbertofilippo at tiscali.it [mailto:umbertofilippo at tiscali.it] 
Inviato: lunedì 30 ottobre 2017 12:35
A: 'eric at riverbankcomputing.com' <eric at riverbankcomputing.com>
Oggetto: QWebEngineView in QtDesigner

 

I came across this (old) tutorial
<http://eric-ide.python-projects.org/tutorials/MiniBrowser/>  on using Eric
to create a new PyQt project, and using Qt designer to automatically create
.py files.

I am trying 7 years later to adapt it to PyQt5 and QWebEngineView (instead
of the deprecated QWebView).

First of all (a bit out of topic here, will open a new thread probably),
following the tutorial I realized that the “compile form” function in the
Forms tab of the Project-Viewer is throwing an error, and I have to use
pyuic5 from the command line to compile the .ui in .py (similar to what
happens in this SO question
<https://stackoverflow.com/questions/45064145/eric6-cant-compile-in-python-f
orm-could-not-start-pyuic5-exe> ).

I have almost ported everything, but I still have a problem with the
QWebEngineView.

My problemi is that when I run my code, I receive “MainWindow obect has no
attribute QWebEngineView”.

The way I added the View is through Qt designer, following what’s suggested
in the last comment on this Qt forum topic
<https://forum.qt.io/topic/65398/qwebengineview-in-qtdesigner/3> .

What’s probably wrong is that I omitted to (quoting) “add webenginewidgets
to your project file”.

How would I do that?

As I am using PyQt, I do not have any .pro file (which I suppose the term
“project” is referring to).

Does anybody have been succesfull in using Qt Designer to create a form with
QWebEngineView?

 

I hope to have summarized the problem I have so that it is also
understandable.

I am on Windows 10, eric6, PyQt5.9, python 3.6.

 

Thanks for any advice,

Umberto

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/eric/attachments/20171031/868174e7/attachment.html>


More information about the Eric mailing list