21 """ |
21 """ |
22 Constructor |
22 Constructor |
23 |
23 |
24 @param parent reference to the parent widget (QWidget) |
24 @param parent reference to the parent widget (QWidget) |
25 """ |
25 """ |
26 QLabel.__init__(self, parent) |
26 super().__init__(parent) |
27 |
27 |
28 self.setFocusPolicy(Qt.NoFocus) |
28 self.setFocusPolicy(Qt.NoFocus) |
29 self.setCursor(Qt.ArrowCursor) |
29 self.setCursor(Qt.ArrowCursor) |
30 |
30 |
31 def mouseReleaseEvent(self, evt): |
31 def mouseReleaseEvent(self, evt): |
35 @param evt reference to the mouse event (QMouseEvent) |
35 @param evt reference to the mouse event (QMouseEvent) |
36 """ |
36 """ |
37 if evt.button() == Qt.LeftButton: |
37 if evt.button() == Qt.LeftButton: |
38 self.clicked.emit() |
38 self.clicked.emit() |
39 else: |
39 else: |
40 QLabel.mouseReleaseEvent(self, evt) |
40 super().mouseReleaseEvent(evt) |
41 |
41 |
42 def mouseDoubleClickEvent(self, evt): |
42 def mouseDoubleClickEvent(self, evt): |
43 """ |
43 """ |
44 Protected method to handle mouse double click events. |
44 Protected method to handle mouse double click events. |
45 |
45 |
46 @param evt reference to the mouse event (QMouseEvent) |
46 @param evt reference to the mouse event (QMouseEvent) |
47 """ |
47 """ |
48 if evt.button() == Qt.LeftButton: |
48 if evt.button() == Qt.LeftButton: |
49 self.clicked.emit() |
49 self.clicked.emit() |
50 else: |
50 else: |
51 QLabel.mouseDoubleClickEvent(self, evt) |
51 super().mouseDoubleClickEvent(evt) |