PDA

View Full Version : Getting indexes of selected items



gyre
20th November 2007, 12:10
How do I get selected row indexes from my QTableView ?
I have my QAbstrTableModel SelectionBehaviour set to SelectRows
I thought that QAbstractItemView::selectedIndexes will return me these indexes...but I read in the docs that "The default implementation does nothing."
Is there abt way how to do that ? Or how should I reimplement that method?
Or does it have to be reimplemented ?
Thanks

wysota
20th November 2007, 14:04
Use QAbstractItemView::selectionModel() and QItemSelectionModel::selectedIndexes().

jpn
20th November 2007, 19:23
I read in the docs that "The default implementation does nothing."
Is there abt way how to do that ? Or how should I reimplement that method?
Or does it have to be reimplemented ?
No you don't have to reimplement it, it's implemented in QTableView.