From adaef5816fc5cc0d1e80c56b237eab31ec224b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Jen=C3=9Fen?= Date: Wed, 4 Jun 2025 14:27:59 +0200 Subject: [PATCH] QmlDesigner: catch RewritingException when moving nodes found at https://the-qt-company-00.sentry.io/issues/6650630594 Pick-to: qds/4.7 Change-Id: Id968abcc08e601694ae612c6cb0c5fa80aa1c9ff Reviewed-by: Thomas Hartmann --- .../components/navigator/navigatorview.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp index 23ad269a7fc..35c99eff207 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp @@ -70,8 +70,13 @@ inline static void moveNodesUp(const QList &nodes) index--; if (index < 0) index = node.parentProperty().count() - 1; //wrap around - if (oldIndex != index) - node.parentProperty().toNodeListProperty().slide(oldIndex, index); + if (oldIndex != index) { + try { + node.parentProperty().toNodeListProperty().slide(oldIndex, index); + } catch (QmlDesigner::Exception &exception) { + exception.showException(); + } + } } } } @@ -85,8 +90,13 @@ inline static void moveNodesDown(const QList &nodes) index++; if (index >= node.parentProperty().count()) index = 0; //wrap around - if (oldIndex != index) - node.parentProperty().toNodeListProperty().slide(oldIndex, index); + if (oldIndex != index) { + try { + node.parentProperty().toNodeListProperty().slide(oldIndex, index); + } catch (QmlDesigner::Exception &exception) { + exception.showException(); + } + } } } }