View Full Version : How to tell which row is selected in a QtreeView

9th November 2007, 18:12
I have a QTreeView with a subclassed QStandardModel, and I am having difficulty in determining which row(s) is(are) selected. The items are checkable, but in some cases I wish to check which items have been selected by the user so that I can let the user set them to be checked with the click of a button. I can't find out how to do this. Does anyone know how?

9th November 2007, 19:19
Look at QAbstractItemView::selectionModel() and QItemSelectionModel.

9th November 2007, 22:10
That did it, thanks.