ok thank you very much..., but I don't want the indexes. I want the rows.
I can't find a method to get the visible rows. So I have to do a workaround with the QModelIndexes?
Added after 6 minutes:
here is my workaround:
I added a method to my QTableWidget:
QList<int> MyTable::getVisibleSelectedRows()
{
QModelIndexList indexes = selectedIndexes();
QList<int> rows;
for(int i = 0; i < indexes.size(); i++){
int row = indexes.value(i).row();
if(!rows.contains(row))
rows.append(row);
}
return rows;
}
QList<int> MyTable::getVisibleSelectedRows()
{
QModelIndexList indexes = selectedIndexes();
QList<int> rows;
for(int i = 0; i < indexes.size(); i++){
int row = indexes.value(i).row();
if(!rows.contains(row))
rows.append(row);
}
return rows;
}
To copy to clipboard, switch view to plain text mode
Bookmarks