aboutsummaryrefslogtreecommitdiffstats
path: root/examples/animation/appchooser/appchooser.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-07-12 16:56:03 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2016-07-13 11:51:17 +0000
commit090a2dbf62ecff31de21b1b1d2ffb11a7117c61a (patch)
tree2c6e7c25b0e55201dd7509d29023e6035ced4cad /examples/animation/appchooser/appchooser.py
parentc8c9f64eb4657c54f063f01f00116732cb3fc100 (diff)
Port examples
Adapt to Qt 5 and fix license. Done-with: Alexandru Croitor <alexandru.croitor@qt.io> Change-Id: I08fece5bbb9350ddb2e6a5cd3f9c603a9f8d44fd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples/animation/appchooser/appchooser.py')
-rwxr-xr-xexamples/animation/appchooser/appchooser.py29
1 files changed, 13 insertions, 16 deletions
diff --git a/examples/animation/appchooser/appchooser.py b/examples/animation/appchooser/appchooser.py
index 7d0e360..7501bf4 100755
--- a/examples/animation/appchooser/appchooser.py
+++ b/examples/animation/appchooser/appchooser.py
@@ -3,10 +3,10 @@
#############################################################################
##
## Copyright (C) 2010 Riverbank Computing Limited.
-## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-## All rights reserved.
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
##
-## This file is part of the examples of PyQt.
+## This file is part of the PySide examples of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:BSD$
## You may use this file under the terms of the BSD license as follows:
@@ -20,10 +20,10 @@
## notice, this list of conditions and the following disclaimer in
## the documentation and/or other materials provided with the
## distribution.
-## * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-## the names of its contributors may be used to endorse or promote
-## products derived from this software without specific prior written
-## permission.
+## * Neither the name of The Qt Company Ltd nor the names of its
+## contributors may be used to endorse or promote products derived
+## from this software without specific prior written permission.
+##
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -36,20 +36,17 @@
## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+##
## $QT_END_LICENSE$
##
#############################################################################
-# This file was taken from PyQt examples,
-# which are adaptations of the original C++ Qt's examples.
-
-
-from PySide2 import QtCore, QtGui
+from PySide2 import QtCore, QtGui, QtWidgets
import appchooser_rc
-class Pixmap(QtGui.QGraphicsWidget):
+class Pixmap(QtWidgets.QGraphicsWidget):
clicked = QtCore.Signal()
def __init__(self, pix, parent=None):
@@ -90,7 +87,7 @@ if __name__ == '__main__':
import sys
- app = QtGui.QApplication(sys.argv)
+ app = QtWidgets.QApplication(sys.argv)
p1 = Pixmap(QtGui.QPixmap(':/digikam.png'))
p2 = Pixmap(QtGui.QPixmap(':/akregator.png'))
@@ -102,14 +99,14 @@ if __name__ == '__main__':
p3.setGeometry(QtCore.QRectF(236.0, 236.0, 64.0, 64.0))
p4.setGeometry(QtCore.QRectF(0.0, 236.0, 64.0, 64.0))
- scene = QtGui.QGraphicsScene(0, 0, 300, 300)
+ scene = QtWidgets.QGraphicsScene(0, 0, 300, 300)
scene.setBackgroundBrush(QtCore.Qt.white)
scene.addItem(p1)
scene.addItem(p2)
scene.addItem(p3)
scene.addItem(p4)
- window = QtGui.QGraphicsView(scene)
+ window = QtWidgets.QGraphicsView(scene)
window.setFrameStyle(0)
window.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
window.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)