tobby48 6 years ago
parent
commit
ffbd8b7a18
1 changed files with 16 additions and 16 deletions
  1. 16
    16
      src/kr/co/swh/lecture/python/pyqt5/checkbox.py

+ 16
- 16
src/kr/co/swh/lecture/python/pyqt5/checkbox.py View File

@@ -20,29 +20,29 @@ class MyWindow(QMainWindow):
20 20
         self.label.move(50, 20)
21 21
         self.label.resize(220, 60)
22 22
         
23
-        self.radioButton1 = QCheckBox("SWH Academy ", self)
24
-        self.radioButton1.move(20, 90)
25
-        self.radioButton1.setChecked(True)
26
-        self.radioButton1.stateChanged.connect(self.checkBoxState)
23
+        self.checkBox1 = QCheckBox("SWH Academy ", self)
24
+        self.checkBox1.move(20, 90)
25
+        self.checkBox1.setChecked(True)
26
+        self.checkBox1.stateChanged.connect(self.checkBoxState)
27 27
         
28
-        self.radioButton2 = QCheckBox("Coding ", self)
29
-        self.radioButton2.move(140, 90)
30
-        self.radioButton2.stateChanged.connect(self.checkBoxState)
28
+        self.checkBox2 = QCheckBox("Coding ", self)
29
+        self.checkBox2.move(140, 90)
30
+        self.checkBox2.stateChanged.connect(self.checkBoxState)
31 31
         
32
-        self.radioButton3 = QCheckBox("WorldHistory ", self)
33
-        self.radioButton3.move(220, 90)
34
-        self.radioButton3.stateChanged.connect(self.checkBoxState)
32
+        self.checkBox3 = QCheckBox("WorldHistory ", self)
33
+        self.checkBox3.move(220, 90)
34
+        self.checkBox3.stateChanged.connect(self.checkBoxState)
35 35
         
36 36
         self.checkBoxState()
37 37
         
38 38
     def checkBoxState(self):
39 39
         message = ""
40
-        if self.radioButton1.isChecked():
41
-            message += self.radioButton1.text();
42
-        if self.radioButton2.isChecked():
43
-            message += self.radioButton2.text();
44
-        if self.radioButton3.isChecked():
45
-            message += self.radioButton3.text();
40
+        if self.checkBox1.isChecked():
41
+            message += self.checkBox1.text();
42
+        if self.checkBox2.isChecked():
43
+            message += self.checkBox2.text();
44
+        if self.checkBox3.isChecked():
45
+            message += self.checkBox3.text();
46 46
             
47 47
         self.label.setText(message)
48 48