From df2469b4e074f4353ecb77a1b8ce96dc7c5eb82d Mon Sep 17 00:00:00 2001 From: Martin Zibricky Date: Sat, 3 Jan 2015 00:58:28 +0100 Subject: [PATCH] Issue #521: Add test for PySide. --- tests/interactive/test_pyside.py | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/interactive/test_pyside.py diff --git a/tests/interactive/test_pyside.py b/tests/interactive/test_pyside.py new file mode 100644 index 0000000000..8465bb503d --- /dev/null +++ b/tests/interactive/test_pyside.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +#----------------------------------------------------------------------------- +# Copyright (c) 2015, PyInstaller Development Team. +# +# Distributed under the terms of the GNU General Public License with exception +# for distributing bootloader. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + + +import sys + +from PySide import QtCore +from PySide import QtGui + +class MyDialog(QtGui.QDialog): + + def __init__(self): + super(MyDialog, self).__init__() + + self.label = QtGui.QLabel( + u"Press to exit. Some non-ascii chars: řčšěíáŘ", + self) + self.setWindowTitle("Hello World from PySide") + self.resize(400, 200) + self.show() + + def sizeHint(self): + return self.label.sizeHint() + + def keyPressEvent(self, event): + if event.key() == QtCore.Qt.Key_Escape: + self.close() + + +def main(): + app = QtGui.QApplication(sys.argv) + read_formats = ', '.join([unicode(format).lower() \ + for format in QtGui.QImageReader.supportedImageFormats()]) + print("Qt4 plugin paths: " + unicode(list(app.libraryPaths()))) + print("Qt4 image read support: " + read_formats) + print('Qt4 Libraries path: ' + unicode(QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.LibrariesPath))) + ex = MyDialog() + app.exec_() + + +if __name__ == "__main__": + main()