如何从QItemSelection中删除索引或范围

时间:2012-07-09 18:11:58

标签: qt selection

我无法找到QItemSelection.remove()或QItemSelection.deselect()之类的内容。这样做的最佳方式是什么?

1 个答案:

答案 0 :(得分:2)

到目前为止,我发现这样做的最好方法是使用带有合并集的第二个选择来取消选择:

deselection = QItemSelection(curr_index, curr_index)  # Can I coin deselection? ;)
selection.merge(deselection, QItemSelectionModel.Deselect)