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 |