Skip to content

Commit

Permalink
Issue pyinstaller#521: Add test for PySide.
Browse files Browse the repository at this point in the history
  • Loading branch information
matysek committed Jan 2, 2015
1 parent dd88d0e commit df2469b
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions tests/interactive/test_pyside.py
Original file line number Diff line number Diff line change
@@ -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 <ESC> 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()

0 comments on commit df2469b

Please sign in to comment.