-
Notifications
You must be signed in to change notification settings - Fork 2
/
tabs.py
48 lines (33 loc) · 1.11 KB
/
tabs.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
43
44
45
46
47
48
from PySide2 import QtWidgets as qtw
from PySide2 import QtGui as qtg
class Panel(qtw.QWidget):
def __init__(self):
super(Panel, self).__init__()
table = qtw.QTabWidget()
layout_1 = qtw.QHBoxLayout()
layout_2 = qtw.QHBoxLayout()
layout_3 = qtw.QHBoxLayout()
for i in range(6):
layout_1.addWidget(qtw.QPushButton("button {}".format(i)))
for i in range(6):
layout_2.addWidget(qtw.QCheckBox())
for i in range(6):
le = qtw.QLineEdit()
le.setPlaceholderText("insert some text")
layout_3.addWidget(le)
tab_1 = qtw.QWidget()
tab_1.setLayout(layout_1)
tab_2 = qtw.QWidget()
tab_2.setLayout(layout_2)
tab_3 = qtw.QWidget()
tab_3.setLayout(layout_3)
table.addTab(tab_1, "push")
table.addTab(tab_2, "checkbox")
table.addTab(tab_3, "lineedit")
master_layout = qtw.QVBoxLayout()
master_layout.addWidget(table)
self.setLayout(master_layout)
app = qtw.QApplication()
panel = Panel()
panel.show()
app.exec_()