diff options
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/pyqt.rb | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/Library/Formula/pyqt.rb b/Library/Formula/pyqt.rb index 20898543c..67fea3cac 100644 --- a/Library/Formula/pyqt.rb +++ b/Library/Formula/pyqt.rb @@ -35,31 +35,23 @@ class Pyqt < Formula test do python do - # Todo: For brew-test-bot we need to add a timer that quits after 1 s or so. - # Reference: http://zetcode.com/tutorials/pyqt4/firstprograms/ (testpath/'test.py').write <<-EOS.undent import sys from PyQt4 import QtGui, QtCore - class QuitButton(QtGui.QWidget): + class Test(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) - - self.setGeometry(300, 300, 250, 150) - self.setWindowTitle('Quit button') - - quit = QtGui.QPushButton('Close', self) - quit.setGeometry(10, 10, 60, 35) - - self.connect(quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) - - app = QtGui.QApplication(sys.argv) - qb = QuitButton() - qb.show() - app.exec_() - sys.exit(0) + self.setGeometry(300, 300, 400, 150) + self.setWindowTitle('Homebrew') + QtGui.QLabel("Python #{python.version} working with PyQt4. Quitting now...", self).move(50, 50) + QtCore.QTimer.singleShot(2500, QtGui.qApp, QtCore.SLOT('quit()')) + + app = QtGui.QApplication([]) + window = Test() + window.show() + sys.exit(app.exec_()) EOS system python, "test.py" |
