WebBrowser/WebBrowserPage.py

changeset 6139
d24997c47244
parent 6137
27962f3f457f
child 6140
c20e2d414d0d
--- a/WebBrowser/WebBrowserPage.py	Mon Feb 12 18:20:28 2018 +0100
+++ b/WebBrowser/WebBrowserPage.py	Mon Feb 12 18:22:39 2018 +0100
@@ -79,15 +79,20 @@
         self.__printer = None
         self.__badSite = False
         
-##    // Workaround for broken load started/finished signals in QtWebEngine 5.10
-##    if (qstrcmp(qVersion(), "5.10.0") == 0) {
-##        connect(this, &QWebEnginePage::loadProgress, this, [this](int progress) {
-##            if (progress == 100) {
-##                emit loadFinished(true);
-##            }
-##        });
-##    }
-##
+        if qVersionTuple == (5, 10, 0):
+            self.loadProgress.connect(self.__loadProgressSlot)
+    
+    @pyqtSlot(int)
+    def __loadProgressSlot(self, progress):
+        """
+        Private slot to implement a workaround for the loadFinished signal
+        not working properly in Qt 5.10.0.
+        
+        @param progress load progress in percent
+        @type int
+        """
+        if progress == 100:
+            self.loadFinished.emit(True)
     
     def acceptNavigationRequest(self, url, type_, isMainFrame):
         """

eric ide

mercurial