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--;
|
index--;
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
index = node.parentProperty().count() - 1; //wrap around
|
index = node.parentProperty().count() - 1; //wrap around
|
||||||
if (oldIndex != index)
|
if (oldIndex != index) {
|
||||||
node.parentProperty().toNodeListProperty().slide(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++;
|
index++;
|
||||||
if (index >= node.parentProperty().count())
|
if (index >= node.parentProperty().count())
|
||||||
index = 0; //wrap around
|
index = 0; //wrap around
|
||||||
if (oldIndex != index)
|
if (oldIndex != index) {
|
||||||
node.parentProperty().toNodeListProperty().slide(oldIndex, index);
|
try {
|
||||||
|
node.parentProperty().toNodeListProperty().slide(oldIndex, index);
|
||||||
|
} catch (QmlDesigner::Exception &exception) {
|
||||||
|
exception.showException();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user