Is there a signal which is emmited when user selects a row in QTableView
by mouse (sigle selection model)?
views:
326answers:
2
+1
A:
Is it acceptable to listen to activated() or clicked() signals, and retrieve the row from the QModelIndex object they provide?
David Parunakian
2010-01-14 08:14:37
+1
A:
Hey,
Each view has a Selection model :
QItemSelectionModel * QAbstractItemView::selectionModel () const
and with the selection model you can retrieve lots of informations, in your case :
QModelIndexList QItemSelectionModel::selectedRows ( int column = 0 ) const
So :
myTableView->selectionModel()->selectedRows();
You can then retrieve this informations through a signal like :
void QItemSelectionModel::selectionChanged ( const QItemSelection & selected, const QItemSelection & deselected ) [signal]
Hope it helps !
Andy M
2010-01-14 09:29:27
Thanks, it works.
danatel
2010-01-14 11:46:58
vnm
2010-01-14 12:03:02