Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This Python file uses the following encoding: utf-8
- import sys
- import os
- from PySide2.QtGui import QGuiApplication
- from PySide2.QtQml import QQmlApplicationEngine
- from app_modules import *
- # Instastiate a QGuiApplication class in order to acces it in my QmlTranslor.py file
- class App(QGuiApplication):
- pass
- if __name__ == "__main__":
- app = App(sys.argv)
- qmltranslator = QmlTanslator()
- engine = QQmlApplicationEngine()
- engine.rootContext().setContextProperty('translator', qmltranslator)
- engine.load(os.path.join(os.path.dirname(__file__), "main.qml"))
- if not engine.rootObjects():
- sys.exit(-1)
- sys.exit(app.exec_())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement