from PyQt4.QtCore import * from PyQt4.QtGui import * class Janela(QDialog): def __init__(self, parent=None): super(Janela, self).__init__(parent) botao1 = QPushButton("botao 1") botao2 = QPushButton("botao 2") vbox = QVBoxLayout() vbox.addWidget(botao1) vbox.addWidget(botao2) self.setLayout(vbox) self.connect(botao1, SIGNAL("clicked()"), self.click) self.connect(botao2, SIGNAL("clicked()"), self.click) def click(self): print 'oi' form = Janela() form.exec_()
Nenhum comentário:
Postar um comentário