milli
5th May 2011, 00:23
I want to remove selected rows from QTableWidget..When i click on the button,if i have,for example three selected items only 2 are deleted.
Why this occurs?
This is my code:
QList <QTableWidgetItem *> items = ui->tableWidget->selectedItems();
for (int x=0;x<ui->tableWidget->rowCount();x++)
{
if(items.at(x)->isSelected())
ui->tableWidget->removeRow(x);
}
Why this occurs?
This is my code:
QList <QTableWidgetItem *> items = ui->tableWidget->selectedItems();
for (int x=0;x<ui->tableWidget->rowCount();x++)
{
if(items.at(x)->isSelected())
ui->tableWidget->removeRow(x);
}