Commit 912729c7 authored by Valentin Valls's avatar Valentin Valls
Browse files

Use setCurrentIndex

parent c496a6f3
Pipeline #37244 failed with stages
in 80 minutes and 53 seconds
......@@ -769,10 +769,9 @@ class CurvePlotPropertyWidget(qt.QWidget):
selectionModel = self.__tree.selectionModel()
if select is None:
# Break reentrant signals
indices = selectionModel.selectedRows()
index = indices[0] if len(indices) > 0 else qt.QModelIndex()
if index.isValid():
selectionModel.select(qt.QModelIndex(), qt.QItemSelectionModel.Clear)
selectionModel.setCurrentIndex(
qt.QModelIndex(), qt.QItemSelectionModel.Clear
)
return
if select is self.selectedPlotItem():
# Break reentrant signals
......@@ -784,7 +783,7 @@ class CurvePlotPropertyWidget(qt.QWidget):
else:
index = item.index()
selectionModel = self.__tree.selectionModel()
selectionModel.select(index, flags)
selectionModel.setCurrentIndex(index, flags)
def __selectionChanged(self, current: qt.QModelIndex, previous: qt.QModelIndex):
model = self.__tree.model()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment