개정판 fb385cac
Add App.py and delete DTI_PID.db
DTI_PID/DTI_PID/App.py | ||
---|---|---|
1 |
# coding: utf-8 |
|
2 |
|
|
3 |
import sys |
|
4 |
import os |
|
5 |
|
|
6 |
from PyQt5.QtCore import * |
|
7 |
from PyQt5.QtGui import * |
|
8 |
from PyQt5.QtWidgets import * |
|
9 |
from PyQt5.QtSvg import * |
|
10 |
|
|
11 |
from AppDocData import AppDocData |
|
12 |
|
|
13 |
class App(QApplication): |
|
14 |
def __init__(self, args): |
|
15 |
super(App, self).__init__(args) |
|
16 |
appStyle = AppDocData.instance().loadAppStyle() |
|
17 |
self.setStyle(appStyle) |
|
18 |
self.loadStyleSheet(os.path.dirname(os.path.realpath(__file__)) + '\\coffee') |
|
19 |
|
|
20 |
self.mainWnd = None |
|
21 |
|
|
22 |
''' |
|
23 |
@brief load application style sheet |
|
24 |
@author humkyung |
|
25 |
@date 2018.04.07 |
|
26 |
''' |
|
27 |
def loadStyleSheet(self, sheetName): |
|
28 |
file = QFile('%s.qss' % sheetName.lower()) |
|
29 |
file.open(QFile.ReadOnly) |
|
30 |
|
|
31 |
styleSheet = file.readAll() |
|
32 |
styleSheet = str(styleSheet, encoding='utf8') |
|
33 |
|
|
34 |
self.setStyleSheet(styleSheet) |
|
35 |
|
|
36 |
if __name__ == '__main__': |
|
37 |
import DTI_PID_UI |
|
38 |
from ProjectDialog import Ui_Dialog |
|
39 |
from MainWindow import MainWindow |
|
40 |
|
|
41 |
app = App(sys.argv) |
|
42 |
try: |
|
43 |
dlg = Ui_Dialog() |
|
44 |
dlg.show() |
|
45 |
dlg.exec_() |
|
46 |
if dlg.selectedProject is not None: |
|
47 |
AppDocData.instance().setCurrentProject(dlg.selectedProject) |
|
48 |
app.mainWnd = MainWindow.instance() |
|
49 |
app.mainWnd.show() |
|
50 |
except Exception as ex: |
|
51 |
print('에러가 발생했습니다.\n', ex) |
|
52 |
|
|
53 |
sys.exit(app.exec_()) |
내보내기 Unified diff