algajard
16th March 2009, 18:50
Hey kids,
I'm using Qt-4.5 with Qt-Creator running under linux and I have the following problem. I have a QTableWidget with "n" rows. Then I select "m" rows for deletion. My problem is that the method only deletes "m-1" rows from the table.
QList<QTableWidgetSelectionRange> range=tipos_table->selectedRanges();
for(i=0;i<range.size();i++)
{
top=range.at(i).topRow();
bottom=range.at(i).bottomRow();
for(j=top;j<=bottom;j++)
tipos_table->removeRow(j);
}
That is the method I wrote. The method visits all the items but the last item will not be deleted.
Clues, ideas ?
Regards and thanks,
I'm using Qt-4.5 with Qt-Creator running under linux and I have the following problem. I have a QTableWidget with "n" rows. Then I select "m" rows for deletion. My problem is that the method only deletes "m-1" rows from the table.
QList<QTableWidgetSelectionRange> range=tipos_table->selectedRanges();
for(i=0;i<range.size();i++)
{
top=range.at(i).topRow();
bottom=range.at(i).bottomRow();
for(j=top;j<=bottom;j++)
tipos_table->removeRow(j);
}
That is the method I wrote. The method visits all the items but the last item will not be deleted.
Clues, ideas ?
Regards and thanks,