-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.py
34 lines (25 loc) · 885 Bytes
/
index.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
32
33
34
import sys
import os
# https://github.com/ColinDuquesnoy/QDarkStyleSheet
import qdarkstyle
from MainWindowLogic import MainWindowLogic
from MainWindowViewModel import MainWindowViewModel
# set the environment variable to use a specific wrapper
# it can be set to pyqt, pyqt5, pyside or pyside2 (not implemented yet)
# you do not need to use QtPy to set this variable
os.environ['QT_API'] = 'pyqt5'
# import from QtPy instead of doing it directly
# note that QtPy always uses PyQt5 API
from qtpy import QtWidgets;
def main():
app = QtWidgets.QApplication(sys.argv)
vm = MainWindowViewModel()
ui = MainWindowLogic(vm)
# setup stylesheet
# the default system in qdarkstyle uses qtpy environment variable
app.setStyleSheet(qdarkstyle.load_stylesheet())
# ui.showMaximized()
ui.show()
sys.exit(app.exec_())
if __name__ == "__main__":
main()