回答編集履歴

1

pressed,released のコード例を追記

2020/07/18 13:28

投稿

teamikl
teamikl

スコア8664

test CHANGED
@@ -7,6 +7,34 @@
7
7
 
8
8
 
9
9
  シグナル `pressed`, `released` で開始・停止するようにします。
10
+
11
+
12
+
13
+ ```python
14
+
15
+ def startSound(self):
16
+
17
+ print("Start")
18
+
19
+
20
+
21
+ def stopSound(self):
22
+
23
+ print("Stop")
24
+
25
+
26
+
27
+ def UI(self):
28
+
29
+ # 省略
30
+
31
+
32
+
33
+ button.pressed.connect(self.startSound)
34
+
35
+ button.released.connect(self.stopSound)
36
+
37
+ ```
10
38
 
11
39
 
12
40