-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
47 lines (35 loc) · 1.48 KB
/
app.py
File metadata and controls
47 lines (35 loc) · 1.48 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
import sys
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication, QMainWindow
from mvc import MainController, MainModel, MainView
from resources import resources_rc
from ui.mainUI import Ui_MainWindow
class MyWindow(QMainWindow):
"""The main window of the application.
This class initializes the main UI, sets up the window icon, and
assembles the Model-View-Controller (MVC) components for the application's
main screen.
"""
def __init__(self) -> None:
"""Initializes the main window and its components.
Sets up the user interface from the generated Ui_MainWindow class,
configures the window icon, and initializes the MainModel, MainView,
and MainController to establish the application's core architecture.
"""
super().__init__()
self.main_ui: Ui_MainWindow = Ui_MainWindow()
self.main_ui.setupUi(self)
# Set the application icon
icon: QIcon = QIcon(":/icons/icon.ico")
self.setWindowIcon(icon)
# Initialize the MVC architecture for the main application window
self.main_model: MainModel = MainModel()
self.main_view: MainView = MainView(ui=self.main_ui)
self.main_controller: MainController = MainController(
model=self.main_model, view=self.main_view
)
if __name__ == "__main__":
app: QApplication = QApplication(sys.argv)
application: MyWindow = MyWindow()
application.show()
sys.exit(app.exec_())