1#!/usr/bin/env python 2 3 4############################################################################# 5## 6## Copyright (C) 2013 Riverbank Computing Limited. 7## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 8## 9## This file is part of the examples of PyQt. 10## 11## $QT_BEGIN_LICENSE:BSD$ 12## You may use this file under the terms of the BSD license as follows: 13## 14## "Redistribution and use in source and binary forms, with or without 15## modification, are permitted provided that the following conditions are 16## met: 17## * Redistributions of source code must retain the above copyright 18## notice, this list of conditions and the following disclaimer. 19## * Redistributions in binary form must reproduce the above copyright 20## notice, this list of conditions and the following disclaimer in 21## the documentation and/or other materials provided with the 22## distribution. 23## * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 24## of its contributors may be used to endorse or promote products derived 25## from this software without specific prior written permission. 26## 27## 28## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 39## $QT_END_LICENSE$ 40## 41############################################################################# 42 43 44import sys 45import os.path 46 47from PyQt5.QtCore import QUrl 48from PyQt5.QtGui import QGuiApplication 49from PyQt5.QtQuick import QQuickView 50 51# Access the shared module. 52sys.path.insert(1, 53 os.path.join( 54 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 55 'shared')) 56import shared_rc 57 58import animation_rc 59 60 61app = QGuiApplication(sys.argv) 62 63view = QQuickView() 64view.engine().quit.connect(app.quit) 65 66view.setSource(QUrl('qrc:///animation/animation.qml')) 67view.show() 68 69sys.exit(app.exec_()) 70