aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/extending/chapter3-bindings/bindings.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/extending/chapter3-bindings/bindings.py')
-rw-r--r--examples/declarative/extending/chapter3-bindings/bindings.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/declarative/extending/chapter3-bindings/bindings.py b/examples/declarative/extending/chapter3-bindings/bindings.py
index 47e02a6..e87d3f4 100644
--- a/examples/declarative/extending/chapter3-bindings/bindings.py
+++ b/examples/declarative/extending/chapter3-bindings/bindings.py
@@ -98,7 +98,10 @@ if __name__ == '__main__':
view = QQuickView()
view.setResizeMode(QQuickView.SizeRootObjectToView)
- view.setSource(QUrl.fromLocalFile('app.qml'))
+ qmlFile = os.path.join(os.path.dirname(__file__), 'app.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