Style Buttons, re-layout Login
This commit is contained in:
15
main.py
15
main.py
@@ -6,7 +6,7 @@ from PySide6.QtNetwork import QLocalServer, QLocalSocket
|
||||
from PySide6.QtWidgets import QSystemTrayIcon
|
||||
from PySide6.QtGui import QGuiApplication, QIcon
|
||||
from PySide6.QtQml import QQmlApplicationEngine
|
||||
from PySide6.QtCore import QIODevice #, QResource
|
||||
from PySide6.QtCore import QIODevice
|
||||
from lib.ConfigLoader import ConfigLoader
|
||||
from lib.DB.BusinessModel import BusinessModel
|
||||
import rc_pyqcrm
|
||||
@@ -20,7 +20,6 @@ from lib.DB.EmployeeModel import EmployeeModel
|
||||
from lib.DB.ObjectModel import ObjectModel
|
||||
from lib.Printers import Printers
|
||||
|
||||
|
||||
os.environ['QML_XHR_ALLOW_FILE_READ'] = '1'
|
||||
|
||||
# [pyqcrm]
|
||||
@@ -47,6 +46,7 @@ object_model = None
|
||||
printers = None
|
||||
user = None
|
||||
|
||||
|
||||
def initializeProgram():
|
||||
print(f"In {__file__} file, initializeProgram()")
|
||||
global address_model, bad_config, business_model, user, business_type, contact_model, employee_model, object_model, db_con, printers
|
||||
@@ -65,6 +65,7 @@ def initializeProgram():
|
||||
object_model = ObjectModel()
|
||||
publishContext()
|
||||
|
||||
|
||||
def configReady():
|
||||
global bad_config
|
||||
bad_config = False
|
||||
@@ -82,12 +83,11 @@ def publishContext():
|
||||
engine.rootContext().setContextProperty("employee_model", employee_model)
|
||||
engine.rootContext().setContextProperty("object_model", object_model)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
#QResource.registerResource("rc_qml.py")
|
||||
app = QGuiApplication(sys.argv)
|
||||
engine = QQmlApplicationEngine()
|
||||
|
||||
|
||||
pyq_sok = QLocalSocket()
|
||||
pyq_sok.connectToServer("PYQCRM_INSTANCE", QIODevice.ReadOnly)
|
||||
|
||||
@@ -100,9 +100,7 @@ if __name__ == "__main__":
|
||||
pyq_server = QLocalServer()
|
||||
pyq_server.listen("PYQCRM_INSTANCE")
|
||||
|
||||
engine.addImportPath("qrc:/");
|
||||
|
||||
# qml_file = Path(__file__).resolve().parent / "Gui/main.qml"
|
||||
engine.addImportPath("qrc:/")
|
||||
|
||||
qml_file = "qrc:/Gui/main.qml"
|
||||
|
||||
@@ -123,13 +121,12 @@ if __name__ == "__main__":
|
||||
|
||||
engine.rootContext().setContextProperty("config", config)
|
||||
engine.rootContext().setContextProperty("sys_printers", printers)
|
||||
engine.rootContext().setContextProperty("bad_config", bad_config) # print(f"Fehler: {i}")
|
||||
engine.rootContext().setContextProperty("bad_config", bad_config)
|
||||
engine.rootContext().setContextProperty("db_con", db_con)
|
||||
engine.rootContext().setContextProperty("systray", tray)
|
||||
|
||||
engine.load(qml_file)
|
||||
|
||||
|
||||
if not engine.rootObjects():
|
||||
sys.exit(-1)
|
||||
sys.exit(app.exec())
|
||||
|
||||
Reference in New Issue
Block a user