eric7/WebBrowser/WebBrowserView.py

branch
eric7
changeset 8692
9c72f9bc9d72
parent 8687
f671fd72dfb6
child 8695
8a5179bced9e
equal deleted inserted replaced
8691:5dfa59f73de3 8692:9c72f9bc9d72
152 self.__page.quotaRequested.connect(self.__quotaRequested) 152 self.__page.quotaRequested.connect(self.__quotaRequested)
153 # The registerProtocolHandlerRequested signal is handled in 153 # The registerProtocolHandlerRequested signal is handled in
154 # WebBrowserPage. 154 # WebBrowserPage.
155 self.__page.selectClientCertificate.connect( 155 self.__page.selectClientCertificate.connect(
156 self.__selectClientCertificate) 156 self.__selectClientCertificate)
157 with contextlib.suppress(AttributeError, ImportError): 157 self.__page.findTextFinished.connect(self.__findTextFinished)
158 #- Qt >= 5.14
159 from PyQt6.QtWebEngineCore import QWebEngineFindTextResult
160 # __IGNORE_WARNING__
161
162 self.__page.findTextFinished.connect(
163 self.__findTextFinished)
164 158
165 def __setRwhvqt(self): 159 def __setRwhvqt(self):
166 """ 160 """
167 Private slot to set widget that receives input events. 161 Private slot to set widget that receives input events.
168 """ 162 """
542 # the main loop 536 # the main loop
543 537
544 def _contextMenuEvent(self, evt): 538 def _contextMenuEvent(self, evt):
545 """ 539 """
546 Protected method called to create a context menu. 540 Protected method called to create a context menu.
547
548 This method is overridden from QWebEngineView.
549 541
550 @param evt reference to the context menu event object 542 @param evt reference to the context menu event object
551 (QContextMenuEvent) 543 (QContextMenuEvent)
552 """ 544 """
553 self.__menu.clear() 545 self.__menu.clear()
1503 1495
1504 def _gestureEvent(self, evt): 1496 def _gestureEvent(self, evt):
1505 """ 1497 """
1506 Protected method handling gesture events. 1498 Protected method handling gesture events.
1507 1499
1508 @param evt reference to the gesture event (QGestureEvent 1500 @param evt reference to the gesture event
1501 @type QGestureEvent
1509 """ 1502 """
1510 pinch = evt.gesture(Qt.GestureType.PinchGesture) 1503 pinch = evt.gesture(Qt.GestureType.PinchGesture)
1511 if pinch: 1504 if pinch:
1512 if pinch.state() == Qt.GestureState.GestureStarted: 1505 if pinch.state() == Qt.GestureState.GestureStarted:
1513 pinch.setTotalScaleFactor(self.__currentZoom / 100.0) 1506 pinch.setTotalScaleFactor(self.__currentZoom / 100.0)

eric ide

mercurial