aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/signals/qmltopy2
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2017-10-13 16:35:40 +0200
committerFriedemann Kleint <[email protected]>2017-10-13 16:35:52 +0200
commitbd0c77f81fcc66e2cd57d78123bd1ea5ece3cb28 (patch)
tree757aebd9db2e1198f3c1d5bacbddfb25a45c8a3c /examples/declarative/signals/qmltopy2
parent29bf933c9244883b570a9d53e900415fdcf7d437 (diff)
parentb43152d1708b51f7d5c62c7a249c776354f745f5 (diff)
Merge remote-tracking branch 'origin/5.9' into devHEADdev
Diffstat (limited to 'examples/declarative/signals/qmltopy2')
-rwxr-xr-xexamples/declarative/signals/qmltopy2/main.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/declarative/signals/qmltopy2/main.py b/examples/declarative/signals/qmltopy2/main.py
index 2526ede..bb84f27 100755
--- a/examples/declarative/signals/qmltopy2/main.py
+++ b/examples/declarative/signals/qmltopy2/main.py
@@ -42,6 +42,7 @@
from __future__ import print_function
+import os
import sys
from PySide2.QtCore import QObject, QUrl, Slot
from PySide2.QtGui import QGuiApplication
@@ -68,7 +69,10 @@ if __name__ == '__main__':
context = view.rootContext()
context.setContextProperty("rotatevalue", rotatevalue)
- view.setSource(QUrl('view.qml'))
+ qmlFile = os.path.join(os.path.dirname(__file__), 'view.qml')
+ view.setSource(QUrl.fromLocalFile(qmlFile))
+ if view.status() == QQuickView.Error:
+ sys.exit(-1)
view.show()
res = app.exec_()
# Deleting the view before it goes out of scope is required to make sure all child QML instances