176 |
176 |
177 @param index index of item to be selected (QModelIndex) |
177 @param index index of item to be selected (QModelIndex) |
178 """ |
178 """ |
179 if index.isValid(): |
179 if index.isValid(): |
180 self.setCurrentIndex(index) |
180 self.setCurrentIndex(index) |
181 flags = QItemSelectionModel.SelectionFlags( |
181 self.selectionModel().select( |
|
182 index, |
182 QItemSelectionModel.SelectionFlag.ClearAndSelect | |
183 QItemSelectionModel.SelectionFlag.ClearAndSelect | |
183 QItemSelectionModel.SelectionFlag.Rows |
184 QItemSelectionModel.SelectionFlag.Rows |
184 ) |
185 ) |
185 self.selectionModel().select(index, flags) |
|
186 |
186 |
187 def _setItemSelected(self, index, selected): |
187 def _setItemSelected(self, index, selected): |
188 """ |
188 """ |
189 Protected method to set the selection status of an item. |
189 Protected method to set the selection status of an item. |
190 |
190 |