Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直找不到像 QItemSelection.remove() 或 QItemSelection.deselect() 这样的东西。做这个的最好方式是什么?
到目前为止,我发现这样做的最好方法是使用带有合并集的第二个选择来取消选择:
deselection = QItemSelection(curr_index, curr_index) # Can I coin deselection? ;) selection.merge(deselection, QItemSelectionModel.Deselect)