From 25e5dfe53ff588a449d8b74e6e5d918b565113c4 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 14 Jun 2019 14:27:53 +0200 Subject: [PATCH] QmlDesigner: Do nothing if new and old index are the same Change-Id: If552fad81479a4cd404d2d2966905eb9da8d479d Reviewed-by: Tim Jenssen --- .../qmldesigner/components/navigator/navigatorview.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp index f43081f14b2..57578d866f3 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp @@ -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();