I’ve implemented a custom tablemodel based on QAbstractItemModel. The first column in the ttble includes a checkbox. Selection of a row is enabled.
I’m trying to implement following behaviour:
If I click on the row I want that the checkbox in the first column to be checked or unchecked. How can I do that? It only works if I click on the checkbbox since a setData() with QtCore.Qt.CheckStateRole is triggered.
I’ve implemented a custom tablemodel based on QAbstractItemModel . The first column in the
Share
A way to do that is listen to the pressed signal of QAbstractItemView. The QModelIndex you receive has the row where a mouse butten was pressed, with that you can set the checkbox to checked yourself.