eric6/E5Gui/E5Led.py

changeset 8218
7c09585bd960
parent 8205
4a0f1f896341
child 8268
6b8128e0c9d1
equal deleted inserted replaced
8217:385f60c94548 8218:7c09585bd960
29 @param parent reference to parent widget (QWidget) 29 @param parent reference to parent widget (QWidget)
30 @param color color of the LED (QColor) 30 @param color color of the LED (QColor)
31 @param shape shape of the LED (E5LedCircular, E5LedRectangular) 31 @param shape shape of the LED (E5LedCircular, E5LedRectangular)
32 @param rectRatio ratio width to height, if shape is rectangular (float) 32 @param rectRatio ratio width to height, if shape is rectangular (float)
33 """ 33 """
34 super(E5Led, self).__init__(parent) 34 super().__init__(parent)
35 35
36 if color is None: 36 if color is None:
37 color = QColor("green") 37 color = QColor("green")
38 38
39 self.__led_on = True 39 self.__led_on = True
294 @param parent reference to parent widget (QWidget) 294 @param parent reference to parent widget (QWidget)
295 @param color color of the LED (QColor) 295 @param color color of the LED (QColor)
296 @param shape shape of the LED (E5LedCircular, E5LedRectangular) 296 @param shape shape of the LED (E5LedCircular, E5LedRectangular)
297 @param rectRatio ratio width to height, if shape is rectangular (float) 297 @param rectRatio ratio width to height, if shape is rectangular (float)
298 """ 298 """
299 super(E5ClickableLed, self).__init__(parent, color, shape, rectRatio) 299 super().__init__(parent, color, shape, rectRatio)
300 300
301 self.setCursor(Qt.CursorShape.PointingHandCursor) 301 self.setCursor(Qt.CursorShape.PointingHandCursor)
302 302
303 def mouseReleaseEvent(self, evt): 303 def mouseReleaseEvent(self, evt):
304 """ 304 """
318 evt.button() == Qt.MouseButton.MidButton and 318 evt.button() == Qt.MouseButton.MidButton and
319 self.rect().contains(evt.pos()) 319 self.rect().contains(evt.pos())
320 ): 320 ):
321 self.middleClicked.emit(evt.globalPos()) 321 self.middleClicked.emit(evt.globalPos())
322 else: 322 else:
323 super(E5ClickableLed, self).mouseReleaseEvent(evt) 323 super().mouseReleaseEvent(evt)

eric ide

mercurial