diff options
author | Friedemann Kleint <[email protected]> | 2017-10-13 16:35:40 +0200 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2017-10-13 16:35:52 +0200 |
commit | bd0c77f81fcc66e2cd57d78123bd1ea5ece3cb28 (patch) | |
tree | 757aebd9db2e1198f3c1d5bacbddfb25a45c8a3c /examples/declarative/extending/chapter1-basics/basics.py | |
parent | 29bf933c9244883b570a9d53e900415fdcf7d437 (diff) | |
parent | b43152d1708b51f7d5c62c7a249c776354f745f5 (diff) |
Change-Id: I7f2e832b6642d84028a2a2fb39c6ac896136b7c3
Diffstat (limited to 'examples/declarative/extending/chapter1-basics/basics.py')
-rw-r--r-- | examples/declarative/extending/chapter1-basics/basics.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/declarative/extending/chapter1-basics/basics.py b/examples/declarative/extending/chapter1-basics/basics.py index 64d7ad0..2ed02fd 100644 --- a/examples/declarative/extending/chapter1-basics/basics.py +++ b/examples/declarative/extending/chapter1-basics/basics.py @@ -88,7 +88,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 |