53 @signal faviconChanged() emitted to signal a changed web site icon |
53 @signal faviconChanged() emitted to signal a changed web site icon |
54 @signal safeBrowsingAbort() emitted to indicate an abort due to a safe |
54 @signal safeBrowsingAbort() emitted to indicate an abort due to a safe |
55 browsing event |
55 browsing event |
56 @signal safeBrowsingBad(threatType, threatMessages) emitted to indicate a |
56 @signal safeBrowsingBad(threatType, threatMessages) emitted to indicate a |
57 malicious web site as determined by safe browsing |
57 malicious web site as determined by safe browsing |
|
58 @signal showMessage(str) emitted to show a message in the main window |
|
59 status bar |
58 """ |
60 """ |
59 sourceChanged = pyqtSignal(QUrl) |
61 sourceChanged = pyqtSignal(QUrl) |
60 forwardAvailable = pyqtSignal(bool) |
62 forwardAvailable = pyqtSignal(bool) |
61 backwardAvailable = pyqtSignal(bool) |
63 backwardAvailable = pyqtSignal(bool) |
62 highlighted = pyqtSignal(str) |
64 highlighted = pyqtSignal(str) |
63 search = pyqtSignal(QUrl) |
65 search = pyqtSignal(QUrl) |
64 zoomValueChanged = pyqtSignal(int) |
66 zoomValueChanged = pyqtSignal(int) |
65 faviconChanged = pyqtSignal() |
67 faviconChanged = pyqtSignal() |
66 safeBrowsingAbort = pyqtSignal() |
68 safeBrowsingAbort = pyqtSignal() |
67 safeBrowsingBad = pyqtSignal(str, str) |
69 safeBrowsingBad = pyqtSignal(str, str) |
|
70 showMessage = pyqtSignal(str) |
68 |
71 |
69 ZoomLevels = [ |
72 ZoomLevels = [ |
70 30, 40, 50, 67, 80, 90, |
73 30, 40, 50, 67, 80, 90, |
71 100, |
74 100, |
72 110, 120, 133, 150, 170, 200, 220, 233, 250, 270, 285, 300, |
75 110, 120, 133, 150, 170, 200, 220, 233, 250, 270, 285, 300, |
162 try: |
165 try: |
163 self.__page.selectClientCertificate.connect( |
166 self.__page.selectClientCertificate.connect( |
164 self.__selectClientCertificate) |
167 self.__selectClientCertificate) |
165 except AttributeError: |
168 except AttributeError: |
166 # pre Qt 5.12 |
169 # pre Qt 5.12 |
|
170 pass |
|
171 try: |
|
172 self.__page.findTextFinished.connect( |
|
173 self.__findTextFinished) |
|
174 except AttributeError: |
|
175 # pre Qt 5.14 |
167 pass |
176 pass |
168 |
177 |
169 def __setRwhvqt(self): |
178 def __setRwhvqt(self): |
170 """ |
179 """ |
171 Private slot to set widget that receives input events. |
180 Private slot to set widget that receives input events. |
519 |
528 |
520 if callback is None: |
529 if callback is None: |
521 self.findText(txt, findFlags) |
530 self.findText(txt, findFlags) |
522 else: |
531 else: |
523 self.findText(txt, findFlags, callback) |
532 self.findText(txt, findFlags, callback) |
|
533 |
|
534 def __findTextFinished(self, result): |
|
535 """ |
|
536 Private slot handling the findTextFinished signal of the web page. |
|
537 |
|
538 @param result reference to the QWebEngineFindTextResult object of the |
|
539 last search |
|
540 @type QWebEngineFindTextResult |
|
541 """ |
|
542 self.showMessage.emit(self.tr("Match {0} of {1}").format( |
|
543 result.activeMatch(), result.numberOfMatches()) |
|
544 ) |
524 |
545 |
525 def contextMenuEvent(self, evt): |
546 def contextMenuEvent(self, evt): |
526 """ |
547 """ |
527 Protected method called to create a context menu. |
548 Protected method called to create a context menu. |
528 |
549 |