-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (22 loc) · 771 Bytes
/
Copy pathmain.py
File metadata and controls
27 lines (22 loc) · 771 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
# main.py
import logging
import os
import sys
from PyQt6.QtWidgets import QApplication
from PyQt6.QtGui import QFont, QIcon
from ui import MainWindow
def main() -> int:
logging.basicConfig(level=logging.INFO)
app = QApplication(sys.argv)
# Устанавливаем иконку приложения
icon_path = os.path.join(os.path.dirname(__file__), "img", "icon.png")
if os.path.exists(icon_path):
app.setWindowIcon(QIcon(icon_path))
# Принудительно фиксируем общий шрифт в пунктах (pt) для единообразия
font = QFont("Segoe UI", 10)
app.setFont(font)
win = MainWindow()
win.show()
return app.exec()
if __name__ == "__main__":
raise SystemExit(main())