Hi,
I want to find the way to get the multiple selected row numbers (ex: 2nd and 3rd rows) in a table instead of how many rows are selected. Can any one please tell me the way.
Thank You,
Baluk
Hi,
I want to find the way to get the multiple selected row numbers (ex: 2nd and 3rd rows) in a table instead of how many rows are selected. Can any one please tell me the way.
Thank You,
Baluk
Last edited by baluk; 28th September 2010 at 16:23.
Qt Code:
for(short s=0; s < table->rowCount(); s++) { if(table->item(s,0)->isSelected()) { qDebug()<<"Row "<<s<<"is selected!"; } }To copy to clipboard, switch view to plain text mode
this would work, but there are better ways i think
Thnaks man. I got the other way around this problem. It works very fine.
Qt Code:
QModelIndexList selected = selectionModel->selectedRows(); for(int i= 0; i< selected.count();i++) { qDebug() << index.row(); }To copy to clipboard, switch view to plain text mode
I got the code from one of the old posts in this forum.
Bookmarks