<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.StileMessaggioDiPostaElettronica18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.StileMessaggioDiPostaElettronica19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=IT link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Dear all,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>All file names written in this message refers to the already mentioned <a href="http://eric-ide.python-projects.org/tutorials/MiniBrowser/">Jaime Seuma’s tutorial</a>. <o:p></o:p></p><p class=MsoNormal>I found the problem.<o:p></o:p></p><p class=MsoNormal>Apparently, it was not a matter of missing import in the project.<o:p></o:p></p><p class=MsoNormal>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)”.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So I had to reflect this in my “on_btnNavigate_released()” method.<o:p></o:p></p><p class=MsoNormal>Now my working code (mainwindow.py) looks like (only on_btnNavigate_released part):<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>@pyqtSlot()<o:p></o:p></p><p class=MsoNormal> def on_btnNavigate_released(self):<o:p></o:p></p><p class=MsoNormal> """<o:p></o:p></p><p class=MsoNormal> Public slot invoked when the user clicks the Navigate Button .<o:p></o:p></p><p class=MsoNormal> """<o:p></o:p></p><p class=MsoNormal> self.widget.setUrl(QUrl(self.txtUrl.text()))<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hope this will be of help.<o:p></o:p></p><p class=MsoNormal>I really thank Jaime for taking the time back in the years to making the tutorial!<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Cheers,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='mso-fareast-language:IT'>Da:</span></b><span style='mso-fareast-language:IT'> umbertofilippo@tiscali.it [mailto:umbertofilippo@tiscali.it] <br><b>Inviato:</b> luned́ 30 ottobre 2017 12:35<br><b>A:</b> 'eric@riverbankcomputing.com' <eric@riverbankcomputing.com><br><b>Oggetto:</b> QWebEngineView in QtDesigner<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I came across <a href="http://eric-ide.python-projects.org/tutorials/MiniBrowser/">this (old) tutorial</a> on using Eric to create a new PyQt project, and using Qt designer to automatically create .py files.<o:p></o:p></p><p class=MsoNormal>I am trying 7 years later to adapt it to PyQt5 and QWebEngineView (instead of the deprecated QWebView).<o:p></o:p></p><p class=MsoNormal>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 <a href="https://stackoverflow.com/questions/45064145/eric6-cant-compile-in-python-form-could-not-start-pyuic5-exe">this SO question</a>).<o:p></o:p></p><p class=MsoNormal>I have almost ported everything, but I still have a problem with the QWebEngineView.<o:p></o:p></p><p class=MsoNormal>My problemi is that when I run my code, I receive “MainWindow obect has no attribute QWebEngineView”.<o:p></o:p></p><p class=MsoNormal>The way I added the View is through Qt designer, following what’s suggested in <a href="https://forum.qt.io/topic/65398/qwebengineview-in-qtdesigner/3">the last comment on this Qt forum topic</a>.<o:p></o:p></p><p class=MsoNormal>What’s probably wrong is that I omitted to (quoting) “<i>add webenginewidgets to your project file</i>”.<o:p></o:p></p><p class=MsoNormal>How would I do that?<o:p></o:p></p><p class=MsoNormal>As I am using PyQt, I do not have any .pro file (which I suppose the term “project” is referring to).<o:p></o:p></p><p class=MsoNormal>Does anybody have been succesfull in using Qt Designer to create a form with QWebEngineView?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I hope to have summarized the problem I have so that it is also understandable.<o:p></o:p></p><p class=MsoNormal>I am on Windows 10, eric6, PyQt5.9, python 3.6.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for any advice,<o:p></o:p></p><p class=MsoNormal>Umberto<o:p></o:p></p></div></body></html>