-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
34 lines (28 loc) · 911 Bytes
/
Copy pathmain.py
File metadata and controls
34 lines (28 loc) · 911 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
29
30
31
32
33
34
import sys
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QApplication
from platform_check import ensure_platform_ready
from ui_main import create_main_window, load_app_icon, load_stylesheet
def main() -> int:
code = ensure_platform_ready()
if code != 0:
return code
QApplication.setHighDpiScaleFactorRoundingPolicy(
Qt.HighDpiScaleFactorRoundingPolicy.PassThrough
)
app = QApplication(sys.argv)
app.setStyle("Fusion")
app.setApplicationName("Amper")
app.setOrganizationName("Amper")
app.setQuitOnLastWindowClosed(False)
app_icon = load_app_icon()
if not app_icon.isNull():
app.setWindowIcon(app_icon)
stylesheet = load_stylesheet()
if stylesheet:
app.setStyleSheet(stylesheet)
window = create_main_window()
window.show()
return app.exec()
if __name__ == "__main__":
raise SystemExit(main())