QmlDesigner: Do nothing if new and old index are the same

Change-Id: If552fad81479a4cd404d2d2966905eb9da8d479d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2019-06-14 14:27:53 +02:00
parent 1dae4593cc
commit 25e5dfe53f

View File

@@ -394,7 +394,8 @@ void NavigatorView::upButtonClicked()
index--;
if (index < 0)
index = node.parentProperty().count() - 1; //wrap around
node.parentProperty().toNodeListProperty().slide(oldIndex, index);
if (oldIndex != index)
node.parentProperty().toNodeListProperty().slide(oldIndex, index);
}
}
updateItemSelection();
@@ -411,7 +412,8 @@ void NavigatorView::downButtonClicked()
index++;
if (index >= node.parentProperty().count())
index = 0; //wrap around
node.parentProperty().toNodeListProperty().slide(oldIndex, index);
if (oldIndex != index)
node.parentProperty().toNodeListProperty().slide(oldIndex, index);
}
}
updateItemSelection();