MCPcopy
hub / github.com/tonquer/JMComic-qt / mousePressEvent

Method mousePressEvent

src/component/button/switch_button.py:23–29  ·  view source on GitHub ↗

鼠标点击事件:用于切换按钮状态

(self, event)

Source from the content-addressed store, hash-verified

21 self.state = state # 按钮状态:True表示开,False表示关
22
23 def mousePressEvent(self, event):
24 """鼠标点击事件:用于切换按钮状态"""
25 super(SwitchButton, self).mousePressEvent(event)
26
27 state = False if self.state else True
28 self.SetState(state)
29 self.Switch.emit(self.state)
30
31 def SetState(self, state):
32 self.state = state

Callers

nothing calls this directly

Calls 2

SetStateMethod · 0.95
emitMethod · 0.80

Tested by

no test coverage detected