Select rows and columns in table view
-
I created a table model by sub-classing QStandardItemModel and I used QTableView to create the view.
I want to get the appropriate row and column selected, when I click a cell in the table view. For example, if I select the cell (2,2) I must get the second row and the second column selected.
How ? -
Someting like "this":http://qt-project.org/doc/qt-4.8/qtableview.html ?
See the comment at the bottom of the page.
-
Hi franku,
The problem is not how to be notified when a selection occurs or how to get the selected indexes.
The problem is how to make an index's (QModelIndex) appropriate row and column selected !The example is at : http://www.iissam.com/sources/codes.php (AHP method)
CriteriaWizardPage.cpp :
@
115 QModelIndex selection = m_matrixView->currentIndex();
116 int row = selection.row();
@