Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from PyQt4 import QtGui, QtCore
- class Example(QtGui.QWidget):
- def __init__(self):
- super(Example, self).__init__()
- self.initUI()
- def initUI(self):
- btn = QtGui.QPushButton(self)
- vbox = QtGui.QVBoxLayout()
- vbox.addWidget(btn)
- self.setLayout(vbox)
- QtCore.QObject.connect(btn, QtCore.SIGNAL("clicked()"), self.revealButton)
- self.setGeometry(300, 300, 250, 150)
- self.setWindowTitle('Signal & slot')
- self.show()
- def revealButton(self):
- print("kuku")
- def main():
- app = QtGui.QApplication(sys.argv)
- ex = Example()
- sys.exit(app.exec_())
- if __name__ == '__main__':
- main()
Add Comment
Please, Sign In to add comment