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

Method mousePressEvent

QPropertyAnimation/FlipWidgetAnimation.py:35–44  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

33 self.setPixmap(QPixmap('Data/1.png'))
34
35 def mousePressEvent(self, event):
36 super(LoginWidget, self).mousePressEvent(event)
37 pos = event.pos()
38 if pos.y() <= 40:
39 if pos.x() > self.width() - 30:
40 # 点击关闭按钮的地方
41 self.windowClosed.emit()
42 elif self.width() - 90 <= pos.x() <= self.width() - 60:
43 # 点击切换按钮
44 self.windowChanged.emit()
45
46
47class SettingWidget(QLabel):

Callers 1

mousePressEventMethod · 0.45

Calls 3

yMethod · 0.80
xMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected