diff options
author | Tor Norbye <tnorbye@google.com> | 2014-09-04 13:24:04 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-09-04 13:24:04 -0700 |
commit | c3d3a90f6b4ead083d63e28e6b9fcea93d675678 (patch) | |
tree | fc0dcd722b6d445468dbe7dad13b4c11781b1cbe /python/helpers/pydev/tests_mainloop/gui-qt.py | |
parent | 1aa2e09bdbd413eacb677e9fa4b50630530d0656 (diff) | |
download | idea-c3d3a90f6b4ead083d63e28e6b9fcea93d675678.tar.gz |
Snapshot idea/138.1980 from git://git.jetbrains.org/idea/community.git
Change-Id: Ib567c9c152d770212a7a3db20fbf591c210920bd
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() |