Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Qt 如何从QItemSelection中删除索引或范围_Qt_Selection - Fatal编程技术网

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

Qt 如何从QItemSelection中删除索引或范围,qt,selection,Qt,Selection,我找不到任何类似QItemSelection.remove()或QItemSelection.deselect()的内容。最好的方法是什么?到目前为止,我发现最好的方法是使用第二个选择,将“合并”设置为“取消选择”: deselection = QItemSelection(curr_index, curr_index) # Can I coin deselection? ;) selection.merge(deselection, QItemSelectionModel.Deselect)

我找不到任何类似QItemSelection.remove()或QItemSelection.deselect()的内容。最好的方法是什么?

到目前为止,我发现最好的方法是使用第二个选择,将“合并”设置为“取消选择”:

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