eric6/WebBrowser/UrlBar/FavIconLabel.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
25 super(FavIconLabel, self).__init__(parent) 25 super(FavIconLabel, self).__init__(parent)
26 26
27 self.__browser = None 27 self.__browser = None
28 self.__dragStartPos = QPoint() 28 self.__dragStartPos = QPoint()
29 29
30 self.setFocusPolicy(Qt.NoFocus) 30 self.setFocusPolicy(Qt.FocusPolicy.NoFocus)
31 self.setCursor(Qt.ArrowCursor) 31 self.setCursor(Qt.CursorShape.ArrowCursor)
32 self.setMinimumSize(16, 16) 32 self.setMinimumSize(16, 16)
33 self.resize(16, 16) 33 self.resize(16, 16)
34 34
35 self.__browserIconChanged() 35 self.__browserIconChanged()
36 36
63 """ 63 """
64 Protected method to handle mouse press events. 64 Protected method to handle mouse press events.
65 65
66 @param evt reference to the mouse event (QMouseEvent) 66 @param evt reference to the mouse event (QMouseEvent)
67 """ 67 """
68 if evt.button() == Qt.LeftButton: 68 if evt.button() == Qt.MouseButton.LeftButton:
69 self.__dragStartPos = evt.pos() 69 self.__dragStartPos = evt.pos()
70 super(FavIconLabel, self).mousePressEvent(evt) 70 super(FavIconLabel, self).mousePressEvent(evt)
71 71
72 def mouseReleaseEvent(self, evt): 72 def mouseReleaseEvent(self, evt):
73 """ 73 """
74 Protected method to handle mouse release events. 74 Protected method to handle mouse release events.
75 75
76 @param evt reference to the mouse event (QMouseEvent) 76 @param evt reference to the mouse event (QMouseEvent)
77 """ 77 """
78 if evt.button() == Qt.LeftButton: 78 if evt.button() == Qt.MouseButton.LeftButton:
79 self.__showPopup(evt.globalPos()) 79 self.__showPopup(evt.globalPos())
80 super(FavIconLabel, self).mouseReleaseEvent(evt) 80 super(FavIconLabel, self).mouseReleaseEvent(evt)
81 81
82 def mouseMoveEvent(self, evt): 82 def mouseMoveEvent(self, evt):
83 """ 83 """
84 Protected method to handle mouse move events. 84 Protected method to handle mouse move events.
85 85
86 @param evt reference to the mouse event (QMouseEvent) 86 @param evt reference to the mouse event (QMouseEvent)
87 """ 87 """
88 if ( 88 if (
89 evt.button() == Qt.LeftButton and 89 evt.button() == Qt.MouseButton.LeftButton and
90 ((evt.pos() - self.__dragStartPos).manhattanLength() > 90 ((evt.pos() - self.__dragStartPos).manhattanLength() >
91 QApplication.startDragDistance()) and 91 QApplication.startDragDistance()) and
92 self.__browser is not None 92 self.__browser is not None
93 ): 93 ):
94 drag = QDrag(self) 94 drag = QDrag(self)

eric ide

mercurial