Hi, I'm sure this is an easy one for you guys. How can I make the QComboBox drive the amount of rows of the QTableWidget. For example, I want the amount of rows to reflect the selected index of the comboBox and it needs to reset itself every time I select a new index.
Thanks! from PySide.QtGui import * from PySide.QtCore import * class Panel(QWidget): def __init__(self): super(Panel, self).__init__() self.combo = QComboBox() self.combo.addItems(['1','2','3','4']) self.vlayout = QVBoxLayout() self.vlayout.addWidget(self.combo) self.vlayout.addWidget(self.buildTable(self.combo.currentText())) self.setLayout(self.vlayout) self.resize(400,200) self.combo.currentIndexChanged.connect(lambda:self.buildTable(self.combo.currentText())) def buildTable(self, date): self.table = QTableWidget() self.table.setColumnCount(2) print 'set rows : ', int(date) self.table.setRowCount(int(date)) return self.table def start(): start.panel = Panel() start.panel.show() start() -- Bruno-Pierre Jobin www.bpjobin.com
_______________________________________________ PySide mailing list PySide@qt-project.org http://lists.qt-project.org/mailman/listinfo/pyside