WebBrowser/WebBrowserPage.py

changeset 6139
d24997c47244
parent 6137
27962f3f457f
child 6140
c20e2d414d0d
equal deleted inserted replaced
6138:b235f6fe5c9f 6139:d24997c47244
77 self.urlChanged.connect(self.__urlChanged) 77 self.urlChanged.connect(self.__urlChanged)
78 78
79 self.__printer = None 79 self.__printer = None
80 self.__badSite = False 80 self.__badSite = False
81 81
82 ## // Workaround for broken load started/finished signals in QtWebEngine 5.10 82 if qVersionTuple == (5, 10, 0):
83 ## if (qstrcmp(qVersion(), "5.10.0") == 0) { 83 self.loadProgress.connect(self.__loadProgressSlot)
84 ## connect(this, &QWebEnginePage::loadProgress, this, [this](int progress) { 84
85 ## if (progress == 100) { 85 @pyqtSlot(int)
86 ## emit loadFinished(true); 86 def __loadProgressSlot(self, progress):
87 ## } 87 """
88 ## }); 88 Private slot to implement a workaround for the loadFinished signal
89 ## } 89 not working properly in Qt 5.10.0.
90 ## 90
91 @param progress load progress in percent
92 @type int
93 """
94 if progress == 100:
95 self.loadFinished.emit(True)
91 96
92 def acceptNavigationRequest(self, url, type_, isMainFrame): 97 def acceptNavigationRequest(self, url, type_, isMainFrame):
93 """ 98 """
94 Public method to determine, if a request may be accepted. 99 Public method to determine, if a request may be accepted.
95 100

eric ide

mercurial