-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (24 loc) · 883 Bytes
/
main.py
File metadata and controls
28 lines (24 loc) · 883 Bytes
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
import sys
from PyQt5.QtWidgets import QApplication
from ui.main_window import MainWindow
from ui.utils import resource_path
def main():
app = QApplication(sys.argv)
# Загрузка стилей
try:
style_path = resource_path("ui/styles.qss")
with open(style_path, "r") as f:
app.setStyleSheet(f.read())
except FileNotFoundError:
print("Файл стилей не найден, используется стандартная тема.")
# Опционально: установка темной темы (если установлен qdarkstyle)
try:
import qdarkstyle
app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
except ImportError:
pass
window = MainWindow()
window.show()
sys.exit(app.exec_())
if __name__ == "__main__":
main()