(self, name, colorimg, signal, *args, **kwargs)
| 28 | class SkinBaseItemWidget(QWidget): |
| 29 | |
| 30 | def __init__(self, name, colorimg, signal, *args, **kwargs): |
| 31 | super(SkinBaseItemWidget, self).__init__(*args, **kwargs) |
| 32 | self.setObjectName('skinBaseItemWidget') |
| 33 | # 加载鼠标样式 |
| 34 | ThemeManager.loadCursor(self, ThemeManager.CursorPointer) |
| 35 | self.name = name |
| 36 | self.colorimg = colorimg |
| 37 | self.hovered = False |
| 38 | self.signal = signal |
| 39 | self.colorHover = QColor(0, 0, 0, 40) |
| 40 | self._textHoverColor = QColor(18, 183, 245) |
| 41 | self.textColor = QColor(102, 102, 102) |
| 42 | self.image = None |
| 43 | # 图片 |
| 44 | if isinstance(self.colorimg, str) and os.path.isfile(self.colorimg): |
| 45 | self.image = QPixmap(self.colorimg).scaled(PixmapWidth, |
| 46 | PixmapHeight, |
| 47 | Qt.IgnoreAspectRatio, |
| 48 | Qt.SmoothTransformation) |
| 49 | |
| 50 | def click(self): |
| 51 | self.signal.emit(self.name, self.colorimg) |
nothing calls this directly
no test coverage detected