-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdesktop_app.py
More file actions
37 lines (29 loc) · 933 Bytes
/
desktop_app.py
File metadata and controls
37 lines (29 loc) · 933 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
35
from __future__ import annotations
import sys
from pathlib import Path
from PySide6 import QtWidgets, QtGui, QtCore
from ui.main_window import MainWindow
from ui.theme import app_stylesheet
def main() -> None:
app = QtWidgets.QApplication(sys.argv)
# App identity for dev runs
QtCore.QCoreApplication.setApplicationName("AskDB")
# QtCore.QCoreApplication.setApplicationDisplayName("AskDB")
QtCore.QCoreApplication.setOrganizationName("AskDB")
# App icon for dev runs
root = Path(__file__).resolve().parent
logo = root / "assets" / "logo.png"
if logo.exists():
icon = QtGui.QIcon(str(logo))
app.setWindowIcon(icon)
app.setStyleSheet(app_stylesheet())
w = MainWindow()
try:
if logo.exists():
w.setWindowIcon(QtGui.QIcon(str(logo)))
except Exception:
pass
w.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()