From 7ac420e9e8eaa2e712c9eac8724b6ad3e980052a 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 Change-Id: Id968abcc08e601694ae612c6cb0c5fa80aa1c9ff Reviewed-by: Thomas Hartmann (cherry picked from commit adaef5816fc5cc0d1e80c56b237eab31ec224b38) Reviewed-by: Qt Cherry-pick Bot --- .../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 5fa18097202..b0e9aa386c1 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp @@ -67,8 +67,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(); + } + } } } } @@ -82,8 +87,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(); + } + } } } }