PDA

View Full Version : cell selection in QTableView



user
23rd May 2008, 01:03
I have a QTableView using QSpinBox delegate and a dial which is not part of the table.
I want the dial to be updated when I change cells in a specific column.
This works well when I connect the clicked(const QModelIndex &) signal of QStandardItemModel (for my table) and check which cell was clicked.

My problem is that the user can use the arrow keys and enter key to navigate the table. In this case my previously mentioned clicked signal is not called and I can't update the dial.
I've tried other signals (activated, entered) but they don't seem to be called.
Is there a way to know that a cell selection was changed? I don't care if the user used a mouse click or arrow key to navigate the table, so ideally I would like to use the same method for both if possible.

santhoshv84
23rd May 2008, 07:03
Hi,

You better use this signal
tableWidget_cellClicked(int,int)
{
So from here you can get the current row and column of the QTabeWidget

}

jpn
23rd May 2008, 10:57
QAbstractItemView::selectionModel()
QItemSelectionModel::currentChanged()

user
26th May 2008, 01:01
Thank you JPN, That is what I needed.