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

Method mousePressEvent

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

Source from the content-addressed store, hash-verified

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

nothing calls this directly

Calls 5

yMethod · 0.80
mousePressEventMethod · 0.45
heightMethod · 0.45
widthMethod · 0.45
xMethod · 0.45

Tested by

no test coverage detected