| 45 | |
| 46 | |
| 47 | class SettingWidget(QLabel): |
| 48 | # 只是显示设置界面截图 |
| 49 | |
| 50 | windowClosed = pyqtSignal() |
| 51 | windowChanged = pyqtSignal() |
| 52 | |
| 53 | def __init__(self, *args, **kwargs): |
| 54 | super(SettingWidget, self).__init__(*args, **kwargs) |
| 55 | self.setPixmap(QPixmap('Data/2.png')) |
| 56 | |
| 57 | def mousePressEvent(self, event): |
| 58 | super(SettingWidget, self).mousePressEvent(event) |
| 59 | pos = event.pos() |
| 60 | if pos.y() >= self.height() - 30: |
| 61 | if self.width() - 95 <= pos.x() <= self.width() - 10: |
| 62 | # 点击切换按钮 |
| 63 | self.windowChanged.emit() |
| 64 | elif pos.y() <= 40: |
| 65 | if pos.x() > self.width() - 30: |
| 66 | # 点击关闭按钮的地方 |
| 67 | self.windowClosed.emit() |
| 68 | |
| 69 | |
| 70 | class Window(QStackedWidget): |