wally
17th October 2008, 19:37
Hello,
I am looking to select multiple rows in a tablewidget at once, as if the user had Ctrl+clicked or Shift-clicked on the vertical headers.
I have the selection mode set to QAbstractItemView::ExtendedSelection and can perform this operation by clicking.
Using selectRow(int) clears the previous selection. Looking through the source code, selectRow in QTableView calls QTableViewPrivate::selectRow(int, bool).
My guess is that I would have to reimplement QTableView::selectRow() but I'm not quite sure how to do that to get the behaviour I want. I'm working on it in the mean time but if anyone has any suggestions that would be great.
Edit:
I am currently using Python and PyQt4 for most of my development but I am comfortable with C++ as well.
I am looking to select multiple rows in a tablewidget at once, as if the user had Ctrl+clicked or Shift-clicked on the vertical headers.
I have the selection mode set to QAbstractItemView::ExtendedSelection and can perform this operation by clicking.
Using selectRow(int) clears the previous selection. Looking through the source code, selectRow in QTableView calls QTableViewPrivate::selectRow(int, bool).
My guess is that I would have to reimplement QTableView::selectRow() but I'm not quite sure how to do that to get the behaviour I want. I'm working on it in the mean time but if anyone has any suggestions that would be great.
Edit:
I am currently using Python and PyQt4 for most of my development but I am comfortable with C++ as well.