No title Revision 643239633436 (Wed Aug 31 2011 at 04:15) - Diff Link to this snippet: https://friendpaste.com/4Cm20xVTIaHvVqokpfVv3f Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 12345678910111213141516171819202122232425import sysfrom PySide import QtCore, QtGuiclass Test(QtGui.QMainWindow): def __init__(self): QtGui.QMainWindow.__init__(self) self.button = QtGui.QPushButton(self) self.button.setText(QtCore.QString("Push me")) self.setCentralWidget(self.button) self.secondWindow = QtGui.QMainWindow(self) self.secondWindow.setParent(self) self.connect(self.button, QtCore.SIGNAL("clicked()"), self.openSecondWindow) def openSecondWindow(self): print "Activate second window" self.secondWindow.show()if __name__ == '__main__': app = QtGui.QApplication(sys.argv) test = Test() test.show() sys.exit(app.exec_())