forked from qt-creator/qt-creator
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 <thomas.hartmann@qt.io>
This commit is contained in:
@@ -70,8 +70,13 @@ inline static void moveNodesUp(const QList<QmlDesigner::ModelNode> &nodes)
|
||||
index--;
|
||||
if (index < 0)
|
||||
index = node.parentProperty().count() - 1; //wrap around
|
||||
if (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<QmlDesigner::ModelNode> &nodes)
|
||||
index++;
|
||||
if (index >= node.parentProperty().count())
|
||||
index = 0; //wrap around
|
||||
if (oldIndex != index)
|
||||
if (oldIndex != index) {
|
||||
try {
|
||||
node.parentProperty().toNodeListProperty().slide(oldIndex, index);
|
||||
} catch (QmlDesigner::Exception &exception) {
|
||||
exception.showException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user