WebBrowserPage: reintroduced the workaround for the loadFinished signale not working in Qt 5.10 and 5.11.

Tue, 24 Apr 2018 19:11:08 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 24 Apr 2018 19:11:08 +0200
changeset 6268
eb6e49388114
parent 6267
350655a6c85f
child 6269
51a0f31bb240

WebBrowserPage: reintroduced the workaround for the loadFinished signale not working in Qt 5.10 and 5.11.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric6.WebBrowser.WebBrowserPage.html file | annotate | diff | comparison | revisions
WebBrowser/WebBrowserPage.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Sun Apr 22 19:21:44 2018 +0200
+++ b/Documentation/Help/source.qhp	Tue Apr 24 19:11:08 2018 +0200
@@ -17568,6 +17568,7 @@
       <keyword name="WebBrowserPage (Module)" id="WebBrowserPage (Module)" ref="eric6.WebBrowser.WebBrowserPage.html" />
       <keyword name="WebBrowserPage.__featurePermissionRequested" id="WebBrowserPage.__featurePermissionRequested" ref="eric6.WebBrowser.WebBrowserPage.html#WebBrowserPage.__featurePermissionRequested" />
       <keyword name="WebBrowserPage.__fullScreenRequested" id="WebBrowserPage.__fullScreenRequested" ref="eric6.WebBrowser.WebBrowserPage.html#WebBrowserPage.__fullScreenRequested" />
+      <keyword name="WebBrowserPage.__loadProgress" id="WebBrowserPage.__loadProgress" ref="eric6.WebBrowser.WebBrowserPage.html#WebBrowserPage.__loadProgress" />
       <keyword name="WebBrowserPage.__setupChannelTimeout" id="WebBrowserPage.__setupChannelTimeout" ref="eric6.WebBrowser.WebBrowserPage.html#WebBrowserPage.__setupChannelTimeout" />
       <keyword name="WebBrowserPage.__setupWebChannelForUrl" id="WebBrowserPage.__setupWebChannelForUrl" ref="eric6.WebBrowser.WebBrowserPage.html#WebBrowserPage.__setupWebChannelForUrl" />
       <keyword name="WebBrowserPage.__urlChanged" id="WebBrowserPage.__urlChanged" ref="eric6.WebBrowser.WebBrowserPage.html#WebBrowserPage.__urlChanged" />
--- a/Documentation/Source/eric6.WebBrowser.WebBrowserPage.html	Sun Apr 22 19:21:44 2018 +0200
+++ b/Documentation/Source/eric6.WebBrowser.WebBrowserPage.html	Tue Apr 24 19:11:08 2018 +0200
@@ -94,6 +94,9 @@
 <td><a href="#WebBrowserPage.__fullScreenRequested">__fullScreenRequested</a></td>
 <td>Private slot handling a full screen request.</td>
 </tr><tr>
+<td><a href="#WebBrowserPage.__loadProgress">__loadProgress</a></td>
+<td>Private slot to send the loadFinished signal for broken Qt versions.</td>
+</tr><tr>
 <td><a href="#WebBrowserPage.__setupChannelTimeout">__setupChannelTimeout</a></td>
 <td>Private slot to initiate the setup of the web channel.</td>
 </tr><tr>
@@ -230,6 +233,16 @@
 <dd>
 reference to the full screen request
 </dd>
+</dl><a NAME="WebBrowserPage.__loadProgress" ID="WebBrowserPage.__loadProgress"></a>
+<h4>WebBrowserPage.__loadProgress</h4>
+<b>__loadProgress</b>(<i>progress</i>)
+<p>
+        Private slot to send the loadFinished signal for broken Qt versions.
+</p><dl>
+<dt><i>progress</i> (int)</dt>
+<dd>
+load progress in percent
+</dd>
 </dl><a NAME="WebBrowserPage.__setupChannelTimeout" ID="WebBrowserPage.__setupChannelTimeout"></a>
 <h4>WebBrowserPage.__setupChannelTimeout</h4>
 <b>__setupChannelTimeout</b>(<i></i>)
--- a/WebBrowser/WebBrowserPage.py	Sun Apr 22 19:21:44 2018 +0200
+++ b/WebBrowser/WebBrowserPage.py	Tue Apr 24 19:11:08 2018 +0200
@@ -86,6 +86,11 @@
         self.__printer = None
         self.__badSite = False
         
+        if qVersionTuple() >= (5, 10, 0):
+            # Workaround for broken load started/finished signals in
+            # QtWebEngine 5.10, 5.11
+            self.loadProgress.connect(self.__loadProgress)
+        
         # Workaround for changing webchannel world inside
         # acceptNavigationRequest not working
         self.__channelUrl = QUrl()
@@ -95,6 +100,17 @@
         self.__setupChannelTimer.setInterval(100)
         self.__setupChannelTimer.timeout.connect(self.__setupChannelTimeout)
     
+    @pyqtSlot(int)
+    def __loadProgress(self, progress):
+        """
+        Private slot to send the loadFinished signal for broken Qt versions.
+        
+        @param progress load progress in percent
+        @type int
+        """
+        if progress == 100:
+            self.loadFinished.emit(True)
+    
     @pyqtSlot()
     def __setupChannelTimeout(self):
         """

eric ide

mercurial