-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
31 lines (24 loc) · 823 Bytes
/
main.py
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
import sys
from PySide2.QtWidgets import QApplication
from PySide2.QtQml import qmlRegisterType, QQmlApplicationEngine
from PySide2.QtGui import QIcon
from orbitmanager import OrbitManager
if __name__ == "__main__":
"""
Main python file
Register the Python class OrbitManager to the QML system.
Then load the QML application engine and fire up the GUI
"""
sys_argv = sys.argv
sys_argv += ['--style', 'material']
# Create QApplication
app = QApplication(sys_argv)
app.setWindowIcon(QIcon('logo.png'))
# Register Python classes in QML
qmlRegisterType(OrbitManager, 'LOL.OrbitManager', 0, 1, 'OrbitManager')
# Start QML engine
engine = QQmlApplicationEngine()
engine.load('main.qml')
win = engine.rootObjects()[0]
win.show()
sys.exit(app.exec_())