summaryrefslogtreecommitdiff
path: root/examples/hello_quick.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hello_quick.py')
-rw-r--r--examples/hello_quick.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/hello_quick.py b/examples/hello_quick.py
new file mode 100644
index 0000000..0ffa9f2
--- /dev/null
+++ b/examples/hello_quick.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+"""Minimal PySide6 Qt Quick app: loads Main.qml next to this script."""
+
+import sys
+from pathlib import Path
+
+from PySide6.QtGui import QGuiApplication
+from PySide6.QtQml import QQmlApplicationEngine
+
+
+def main() -> int:
+ app = QGuiApplication(sys.argv)
+
+ engine = QQmlApplicationEngine()
+ engine.objectCreationFailed.connect(lambda: sys.exit(1))
+ engine.load(Path(__file__).parent / "Main.qml")
+
+ return app.exec()
+
+
+if __name__ == "__main__":
+ sys.exit(main())