2523:139f182b72f6 | 2525:8b507a9a2d40 |
---|---|
4 # | 4 # |
5 | 5 |
6 """ | 6 """ |
7 Module implementing a clickable label. | 7 Module implementing a clickable label. |
8 """ | 8 """ |
9 | |
10 from __future__ import unicode_literals # __IGNORE_WARNING__ | |
9 | 11 |
10 from PyQt4.QtCore import pyqtSignal, Qt, QPoint | 12 from PyQt4.QtCore import pyqtSignal, Qt, QPoint |
11 from PyQt4.QtGui import QLabel | 13 from PyQt4.QtGui import QLabel |
12 | 14 |
13 | 15 |
27 """ | 29 """ |
28 Constructor | 30 Constructor |
29 | 31 |
30 @param parent reference to the parent widget (QWidget) | 32 @param parent reference to the parent widget (QWidget) |
31 """ | 33 """ |
32 super().__init__(parent) | 34 super(E5ClickableLabel, self).__init__(parent) |
33 | 35 |
34 def mouseReleaseEvent(self, evt): | 36 def mouseReleaseEvent(self, evt): |
35 """ | 37 """ |
36 Protected method handling mouse release events. | 38 Protected method handling mouse release events. |
37 | 39 |
43 else: | 45 else: |
44 self.clicked.emit(evt.globalPos()) | 46 self.clicked.emit(evt.globalPos()) |
45 elif evt.button() == Qt.MiddleButton and self.rect().contains(evt.pos()): | 47 elif evt.button() == Qt.MiddleButton and self.rect().contains(evt.pos()): |
46 self.middleClicked.emit(evt.globalPos()) | 48 self.middleClicked.emit(evt.globalPos()) |
47 else: | 49 else: |
48 super().mouseReleaseEvent(evt) | 50 super(E5ClickableLabel, self).mouseReleaseEvent(evt) |