import sys from PySide import QtCore, QtGui app = QtGui.QApplication(sys.argv) def addWidget(pTree, parentNode, text): #Create new tree widget newTreeWidget = QtGui.QTreeWidgetItem(parentNode, [ "method", "2" ] ) node = QtGui.QPushButton(text) pTree.setItemWidget( newTreeWidget, 1, node ) mainwindow = QtGui.QMainWindow() ################## #Create Tree tree = QtGui.QTreeWidget() tree.setColumnCount(2) tree.setHeaderLabels( [ "Option Names", "Values"] ) #add root item and set a button to it rootItem = QtGui.QTreeWidgetItem(["Settings"]) tree.addTopLevelItem(rootItem) button = QtGui.QPushButton("TEST") tree.setItemWidget(rootItem, 1, button) #add item under rootItem and add a combo box to it addWidget(tree, rootItem, "john") addWidget(tree, rootItem, "frank") #== #add another item under rootitem and add a combo box to it treeWidget = QtGui.QTreeWidgetItem(rootItem, [ "not method", "2" ] ) widget = QtGui.QPushButton("mary") tree.setItemWidget( treeWidget, 1, widget ) #== mainwindow.setCentralWidget(tree) ###################### mainwindow.show() app.exec_() sys.exit()