MCPcopy Index your code
hub / github.com/PyQt5/PyQt / SettingWidget

Class SettingWidget

QPropertyAnimation/FlipWidgetAnimation.py:47–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46
47class 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
70class Window(QStackedWidget):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected