removing row from table. PyQT
MRAB
google at mrabarnett.plus.com
Wed May 6 20:01:46 EDT 2009
Ani wrote:
> I'm trying to remove the selected rows from the table,
> but it's not working, i've tried many ways, don't know what I'm missing.
>
> code below:
>
[snip]
> def remove(self):
> print "removendo da tabela"
> #self.tableWidget.removeRow(self.tableView.selectedIndexes())
> self.tableWidget.removeRow(self.tableWidget.selectedRows)
> #self.mapper.toNext()
> #self.tableView.selectRow(self.mapper.currentIndex())
>
[snip]
From the name I'd say that removeRow() can remove only a single row at a
time. Try removing the rows one at a time, in reverse order (from
highest to lowest index).
More information about the Python-list
mailing list