WebBrowser/WebBrowserPage.py

changeset 6268
eb6e49388114
parent 6234
fb1f9e681848
child 6397
473d410076e9
equal deleted inserted replaced
6267:350655a6c85f 6268:eb6e49388114
84 self.urlChanged.connect(self.__urlChanged) 84 self.urlChanged.connect(self.__urlChanged)
85 85
86 self.__printer = None 86 self.__printer = None
87 self.__badSite = False 87 self.__badSite = False
88 88
89 if qVersionTuple() >= (5, 10, 0):
90 # Workaround for broken load started/finished signals in
91 # QtWebEngine 5.10, 5.11
92 self.loadProgress.connect(self.__loadProgress)
93
89 # Workaround for changing webchannel world inside 94 # Workaround for changing webchannel world inside
90 # acceptNavigationRequest not working 95 # acceptNavigationRequest not working
91 self.__channelUrl = QUrl() 96 self.__channelUrl = QUrl()
92 self.__channelWorldId = -1 97 self.__channelWorldId = -1
93 self.__setupChannelTimer = QTimer(self) 98 self.__setupChannelTimer = QTimer(self)
94 self.__setupChannelTimer.setSingleShot(True) 99 self.__setupChannelTimer.setSingleShot(True)
95 self.__setupChannelTimer.setInterval(100) 100 self.__setupChannelTimer.setInterval(100)
96 self.__setupChannelTimer.timeout.connect(self.__setupChannelTimeout) 101 self.__setupChannelTimer.timeout.connect(self.__setupChannelTimeout)
102
103 @pyqtSlot(int)
104 def __loadProgress(self, progress):
105 """
106 Private slot to send the loadFinished signal for broken Qt versions.
107
108 @param progress load progress in percent
109 @type int
110 """
111 if progress == 100:
112 self.loadFinished.emit(True)
97 113
98 @pyqtSlot() 114 @pyqtSlot()
99 def __setupChannelTimeout(self): 115 def __setupChannelTimeout(self):
100 """ 116 """
101 Private slot to initiate the setup of the web channel. 117 Private slot to initiate the setup of the web channel.

eric ide

mercurial