-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_widget.py
More file actions
52 lines (37 loc) · 1.51 KB
/
Copy pathmain_widget.py
File metadata and controls
52 lines (37 loc) · 1.51 KB
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
49
from PySide6.QtWidgets import QWidget, QHBoxLayout, QPushButton, QVBoxLayout, QTabWidget, QLabel
from pyqtgraph import PlotWidget
class MainWidget(QWidget):
def __init__(self):
super().__init__()
main_layout = QHBoxLayout()
self.tab_widget = QTabWidget()
self.control_tab = QWidget()
self.data_tab = QWidget()
self.graph_tab = QWidget()
self.tab_widget.addTab(self.control_tab, 'Control')
self.tab_widget.addTab(self.data_tab, "Data")
self.tab_widget.addTab(self.graph_tab, "Graphs")
main_layout.addWidget(self.tab_widget)
self.controlTab()
self.graphTab()
self.setLayout(main_layout)
def controlTab(self):
label = QLabel("Control Tab Contents")
button1 = QPushButton("Test")
control_layout = QVBoxLayout(self.control_tab)
control_layout.addWidget(button1)
control_layout.addWidget(label)
def graphTab(self):
plot_1 = PlotWidget(name="Plot 1")
plot_2 = PlotWidget(name="Plot 2")
plot_3 = PlotWidget(name="Plot 3")
plot_4 = PlotWidget(name="Plot 4")
horz_layout_1 = QHBoxLayout()
horz_layout_2 = QHBoxLayout()
horz_layout_1.addWidget(plot_1)
horz_layout_1.addWidget(plot_2)
horz_layout_2.addWidget(plot_3)
horz_layout_2.addWidget(plot_4)
main_layout = QVBoxLayout(self.graph_tab)
main_layout.addLayout(horz_layout_1)
main_layout.addLayout(horz_layout_2)