Advertisement
Guest User

lauro

a guest
Apr 12th, 2009
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. from PyQt4.QtCore import *
  2. from PyQt4.QtGui import *
  3.  
  4.  
  5. class gui(QWidget):
  6.     def __init__(self):
  7.         QWidget.__init__(self)
  8.         self.button = QPushButton(self)
  9.         self.button.setText('click')
  10.         self.button.setObjectName('button1')
  11.         self.show()
  12.  
  13.         QMetaObject.connectSlotsByName(self)
  14.  
  15.     def on_button1_clicked(self):
  16.         print 'Clicked'
  17.  
  18. def main():
  19.     app = QApplication([])
  20.     a = gui()
  21.     app.exec_()
  22.  
  23. if __name__ == '__main__':
  24.     main()
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement