diff options
Diffstat (limited to 'python/helpers/pydev/tests_mainloop/gui-qt.py')
-rw-r--r-- | python/helpers/pydev/tests_mainloop/gui-qt.py | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/python/helpers/pydev/tests_mainloop/gui-qt.py b/python/helpers/pydev/tests_mainloop/gui-qt.py index c27cbd6ff1e6..30fc48d3845a 100644 --- a/python/helpers/pydev/tests_mainloop/gui-qt.py +++ b/python/helpers/pydev/tests_mainloop/gui-qt.py @@ -10,26 +10,27 @@ To run this: Ref: Modified from http://zetcode.com/tutorials/pyqt4/firstprograms/ """ -import sys -from PyQt4 import QtGui, QtCore - -class SimpleWindow(QtGui.QWidget): - def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) - - self.setGeometry(300, 300, 200, 80) - self.setWindowTitle('Hello World') - - quit = QtGui.QPushButton('Close', self) - quit.setGeometry(10, 10, 60, 35) - - self.connect(quit, QtCore.SIGNAL('clicked()'), - self, QtCore.SLOT('close()')) - if __name__ == '__main__': - app = QtCore.QCoreApplication.instance() - if app is None: - app = QtGui.QApplication([]) - - sw = SimpleWindow() - sw.show() + import sys + from PyQt4 import QtGui, QtCore + + class SimpleWindow(QtGui.QWidget): + def __init__(self, parent=None): + QtGui.QWidget.__init__(self, parent) + + self.setGeometry(300, 300, 200, 80) + self.setWindowTitle('Hello World') + + quit = QtGui.QPushButton('Close', self) + quit.setGeometry(10, 10, 60, 35) + + self.connect(quit, QtCore.SIGNAL('clicked()'), + self, QtCore.SLOT('close()')) + + if __name__ == '__main__': + app = QtCore.QCoreApplication.instance() + if app is None: + app = QtGui.QApplication([]) + + sw = SimpleWindow() + sw.show() |