Files
pyqcrm/main.py
2024-10-29 16:24:59 +01:00

54 lines
1007 B
Python

# This Python file uses the following encoding: utf-8
import sys
from pathlib import Path
from PySide6.QtGui import QGuiApplication
from PySide6.QtQml import QQmlApplicationEngine
from lib.ConfigLoader import ConfigLoader
# [pyqcrm]
# program-name=""
# version=
# [database]
# server=""
# port=
# user=""
# password=""
# name=""
# type=""
if __name__ == "__main__":
app = QGuiApplication(sys.argv)
engine = QQmlApplicationEngine()
bad_config = False
qml_file = Path(__file__).resolve().parent / "gui/main.qml"
config = ConfigLoader()
if not config.getConfig():
bad_config = False
# try:
# app_config = config.getConfig()
# if not app_config:
# except Exception as i:
engine.rootContext().setContextProperty("bad_config", bad_config) # print(f"Fehler: {i}")
engine.rootContext().setContextProperty("config", config)
engine.load(qml_file)
if not engine.rootObjects():
sys.exit(-1)
sys.exit(app.exec())