You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.3 KiB
Python

2 years ago
from PyQt5.QtWidgets import QApplication, QStyleFactory
2 years ago
from PyQt5.QtCore import QFile, QTextStream
from UI.MainWindow import MainWindow
2 years ago
from model.ClientModel.Client import Client
2 years ago
2 years ago
from utils import Globals
1 year ago
2 years ago
import time
import sys
2 years ago
class CommonHelper:
def __init__(self):
pass
@staticmethod
def readLocalQss(path):
with open(path,"r") as f:
return f.read()
@staticmethod
def readQrcQss(path):
stream = QFile(':/' + path)
stream.open(QFile.ReadOnly | QFile.Text)
styleSheet = QTextStream(stream).readAll()
stream.close()
return styleSheet
2 years ago
if __name__ == '__main__':
app = QApplication(sys.argv)
2 years ago
app.setStyle(QStyleFactory.create('windowsvisio'))
2 years ago
from Static.Png import qInitResources
qInitResources()
1 year ago
# from Static.QSS import qInitResources
# qInitResources()
# app.setStyleSheet(CommonHelper.readQrcQss('static/Main.qss') + CommonHelper.readQrcQss('static/Area.qss'))
app.setStyleSheet(CommonHelper.readLocalQss('Static/Main.qss') + CommonHelper.readLocalQss('Static/Area.qss'))
2 years ago
Globals._init()
2 years ago
Client.initDB()
2 years ago
window = MainWindow()
2 years ago
window.showFullScreen()
1 year ago
# window.showMaximized()
2 years ago
Globals.setValue('MainWindow', window)
2 years ago
# window.show()
2 years ago
sys.exit(app.exec_())