Solved QTableWidget How to Deselect Row
-
Hello
I have a QTableWidget on my form. I have two buttons, one to perform selection and the other button to perform deselection.
For selection i use the following code:
ui.tableWidget->selectRow(0);
so first row will be selected on my QTableWidget.
But how do i go about deselecting the row when the other button is pressed? I have tried the following but it did not work.
ui.tableWidget->selectionModel()->clearSelection();
Please advise. Thank you.
-
ui.tableWidget->clearSelection();
(inherited from https://doc.qt.io/qt-5/qabstractitemview.html#clearSelection)?
-
ui.tableWidget->clearSelection();
(inherited from https://doc.qt.io/qt-5/qabstractitemview.html#clearSelection)?
-
@JonB oh!! it is working now! thank you.