-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path13. QCheckBox.py
42 lines (28 loc) · 1.11 KB
/
13. QCheckBox.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from PyQt6.QtWidgets import QApplication, QWidget, QHBoxLayout, QCheckBox, QVBoxLayout, QLabel
from PyQt6.QtGui import QIcon
import sys
class Window(QWidget):
def __init__(self):
super().__init__()
self.setGeometry(200,200, 400,200)
self.setWindowTitle("PyQt6 QCheckBox")
self.setWindowIcon(QIcon('./images/python.png'))
hbox = QHBoxLayout()
self.python_chk = QCheckBox("Python")
self.python_chk.setIcon(QIcon("./images/python.png"))
self.javascript_chk = QCheckBox("JavaScript")
self.javascript_chk.setIcon(QIcon("./images/javascript.png"))
self.java_chk = QCheckBox("Java")
self.java_chk.setIcon(QIcon("./images/java.png"))
self.label = QVBoxLayout("Hello")
vbox = QVBoxLayout()
vbox.addWidget(self.label)
hbox.addWidget(self.python_chk)
hbox.addWidget(self.javascript_chk)
hbox.addWidget(self.java_chk)
vbox.addLayout(hbox)
self.setLayout(vbox)
app = QApplication(sys.argv)
Window = Window()
Window.show()
sys.exit(app.exec())