def mousePressEvent(self, event): # Hide the widget if user clicks outside it, otherwise the only way of hiding it # is using Escape key if not self.geometry().contains(event.globalPos()): self.hide() return QWebView.mousePressEvent(self, event)
def __mouse_press_event(self, event): """ Reimplementation from base class. Detects middle clicks and sets self.paste TAB03 """ if event.buttons() & Qt.MiddleButton: self.attr.toggle('paste', 'P') else: self.attr.clear('paste') return QWebView.mousePressEvent(self, event)