class MainWindow(QMainWindow): def __init__(self, *args): QMainWindow.__init__(self, *args) self.cw = QWidget(self) self.setCentralWidget(self.cw) self.btn1 = QPushButton("Click me", self.cw) self.btn1.setGeometry(QRect(0, 0, 100, 30)) self.connect(self.btn1, SIGNAL("clicked()"), self.doit) self.w = None def doit(self): self.w = MyPopup() self.w.setGeometry(QRect(100, 100, 400, 200)) self.w.show()
def doit(self): self.w = MyPopup() self.w.setGeometry(QRect(100, 100, 400, 200)) self.w.show()