-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_window.py
52 lines (41 loc) · 1.33 KB
/
main_window.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
49
50
51
52
import sys
import PySide6.QtGui as qtg
import PySide6.QtWidgets as qtw
from classes.basewidgets import BaseWidget
from classes.block_panel import BlockPanel
from classes.working_zone import WorkingZone
class MainWindow(qtw.QMainWindow):
"""It's a main page of app"""
def __init__(self):
super().__init__()
self.central_widget = MainWidget(self)
self.setCentralWidget(self.central_widget)
self.setMinimumSize(720, 480)
self.setWindowIcon(qtg.QIcon("img/app-block.png"))
self.setWindowTitle("Симулятор передачі даних")
self.show()
class MainWidget(BaseWidget):
"""Inner main widget for main window."""
def __init__(self, parent=None):
super().__init__(parent)
self.init_gui()
def init_gui(self):
"""Separate function for GUI initialization"""
block_panel = BlockPanel(self)
working_zone = WorkingZone(self)
self._init_layout(
[
block_panel,
working_zone
],
margins=(5, 5, 5, 5),
spacing=5
)
self._init_palette({
qtg.QPalette.Window: qtg.QColor("#374B4A")
})
if __name__ == '__main__':
app = qtw.QApplication(sys.argv)
main_window = MainWindow()
app.setStyle('Fusion')
app.exec_()