PDA

View Full Version : How to select a QTableWidget cell containing a QCheckBox



jgver
23rd October 2009, 20:36
I have a QTableWidget in which I have set some cells to contain QCheckBox'es. When the dialog is running, if I click in a cell containing a checkbox, it will be selected, and turn blue. How can I make this happen programmatically? I tried using setCurrentCell() but that seems to invoke a different kind of selection, where the item only turns grey, which is indistinguishable on rows that are already grey (I'm using the "alternating row colors" setting).

Any help would be greatly appreciated!

Jeff

The Storm
23rd October 2009, 22:48
Take a look at QItemSelectionModel. You can get pointer to it from the QTableWidget with the method selectionModel(). Good luck. :)