eric6/WebBrowser/SafeBrowsing/SafeBrowsingLabel.py

changeset 8218
7c09585bd960
parent 8143
2c730d5fd177
equal deleted inserted replaced
8217:385f60c94548 8218:7c09585bd960
25 """ 25 """
26 Constructor 26 Constructor
27 27
28 @param parent reference to the parent widget (QWidget) 28 @param parent reference to the parent widget (QWidget)
29 """ 29 """
30 super(SafeBrowsingLabel, self).__init__(parent) 30 super().__init__(parent)
31 31
32 self.setFocusPolicy(Qt.FocusPolicy.NoFocus) 32 self.setFocusPolicy(Qt.FocusPolicy.NoFocus)
33 self.setCursor(Qt.CursorShape.PointingHandCursor) 33 self.setCursor(Qt.CursorShape.PointingHandCursor)
34 34
35 self.setStyleSheet(SafeBrowsingLabel.nokStyle) 35 self.setStyleSheet(SafeBrowsingLabel.nokStyle)
47 @param evt reference to the mouse event (QMouseEvent) 47 @param evt reference to the mouse event (QMouseEvent)
48 """ 48 """
49 if evt.button() == Qt.MouseButton.LeftButton: 49 if evt.button() == Qt.MouseButton.LeftButton:
50 self.clicked.emit(evt.globalPos()) 50 self.clicked.emit(evt.globalPos())
51 else: 51 else:
52 super(SafeBrowsingLabel, self).mouseReleaseEvent(evt) 52 super().mouseReleaseEvent(evt)
53 53
54 def mouseDoubleClickEvent(self, evt): 54 def mouseDoubleClickEvent(self, evt):
55 """ 55 """
56 Protected method to handle mouse double click events. 56 Protected method to handle mouse double click events.
57 57
58 @param evt reference to the mouse event (QMouseEvent) 58 @param evt reference to the mouse event (QMouseEvent)
59 """ 59 """
60 if evt.button() == Qt.MouseButton.LeftButton: 60 if evt.button() == Qt.MouseButton.LeftButton:
61 self.clicked.emit(evt.globalPos()) 61 self.clicked.emit(evt.globalPos())
62 else: 62 else:
63 super(SafeBrowsingLabel, self).mouseDoubleClickEvent(evt) 63 super().mouseDoubleClickEvent(evt)
64 64
65 @pyqtSlot() 65 @pyqtSlot()
66 def __updateLabel(self): 66 def __updateLabel(self):
67 """ 67 """
68 Private slot to update the label text. 68 Private slot to update the label text.

eric ide

mercurial