Call function when select a row [SOLVED]
-
wrote on 29 Apr 2013, 08:10 last edited by
Hi,
i have implemented a grid with the QTableView class. I want to call a specific function when i select a row and and when i do multiple selection (with ctrl pressed) i want to call another function. How can i do tis?Thanks!
-
check "QTableView::selectionModel()":http://qt-project.org/doc/qt-4.8/qabstractitemview.html#selectionModel and it's signals
-
wrote on 29 Apr 2013, 08:35 last edited by
i can't find my solution there. To be more specific when i click a header of my table i emmit "QHeaderView::sectionClicked":http://qt-project.org/doc/qt-4.8/qheaderview.html#sectionClicked
I want to know how can i make the programm to undestand when i select another row using crtl so i have multiple selection. -
listen to the "selectionChanged signal":http://qt-project.org/doc/qt-4.8/qitemselectionmodel.html#selectionChanged and check selection of rows with "selectedRows":http://qt-project.org/doc/qt-4.8/qitemselectionmodel.html#selectedRows
Is this enough for you? -
wrote on 29 Apr 2013, 09:19 last edited by
ok, thanks a lot
2/5