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

Method mousePressEvent

Demo/Notification.py:133–146  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

131 pass
132
133 def mousePressEvent(self, event):
134 super(NotificationItem, self).mousePressEvent(event)
135 w = self.childAt(event.pos())
136 if not w:
137 return
138 if w == self.labelClose: # 点击关闭图标
139 # 先尝试停止计时器
140 self._timer.stop()
141 self.closed.emit(self.item)
142 elif w == self.labelMessage and self.callback and callable(self.callback):
143 # 点击消息内容
144 self._timer.stop()
145 self.closed.emit(self.item)
146 self.callback() # 回调
147
148 def paintEvent(self, event):
149 # 圆角以及背景色

Callers

nothing calls this directly

Calls 1

stopMethod · 0.45

Tested by

no test coverage detected