Solved How to detect a row index change on a QTableWidget i.e. change of currentRow?
-
...and how do I create an appropriate signal for this?
-
Hi
This is fired when selection changes
http://doc.qt.io/qt-5/qtablewidget.html#currentCellChanged -
The trouble is currentCellChanged only fires if the user edits the cell. I want to detect when the user selects an cell or item in a different row. I tried to achieve this using the signal cellActivated, but it does not seem to fire when I was expecting:
connect(ui->myTableWidget, SIGNAL(cellActivated(int, int)), this, SLOT(checkRowChanged(int, int)));
-
@Guerrian said in How to detect a row index change on a QTableWidget i.e. change of currentRow?:
The trouble is currentCellChanged only fires if the user edits the cell
The documentation states something different:
This signal is emitted whenever the current cell changes. The cell specified by previousRow and previousColumn is the cell that previously had the focus, the cell specified by currentRow and currentColumn is the new current cell.
-
Ah, my mistake I was looking at cellChanged instead of currentCellChanged. Thanks