#I don't use PySide from PyQt4 import * from PyQt4.QtCore import * from PyQt4.QtGui import * import sys class MyMainWindow(QWidget): def __init__(self): QWidget.__init__(self, None) vbox = QVBoxLayout() b = QPushButton("Push me!") vbox.addWidget(b) self.connect(b, SIGNAL("clicked()"), self.buttonPushed) self.setLayout(vbox) def buttonPushed(self): d = QDialog(self) vbox = QVBoxLayout() #Add Layouts horizontalLayout = QHBoxLayout() horizontalLayout1 = QHBoxLayout() # Now create your buttons. b = QPushButton("Close window") c = QPushButton("Die") e = QPushButton("In Fires") f = QPushButton("With Chickens!") self.connect(b, SIGNAL("clicked()"), d.close) # Add buttons to your layouts, they'll show up in the order given. horizontalLayout1.addWidget(f) horizontalLayout1.addWidget(b) horizontalLayout.addWidget(c) horizontalLayout.addWidget(e) # Add layouts to your main Layout vbox.addLayout (horizontalLayout) vbox.addLayout (horizontalLayout1) d.setLayout(vbox) # Show the window! d.show() if __name__ == '__main__': app = QApplication(sys.argv) w = MyMainWindow() w.show() app.exec_() sys.exit()