QmlDesigner: Catch exception that leaves the notifer

No exception should ever leave the view and it should be caught locally.
If this still happens we should catch it and show an error message.
Otherwise we risk throwing a second exception when rewinding, if the
changes came from the text editor.
Catching and showing an error message should never do harm.

Change-Id: If275ed1179e4fa4245fef3df4dbc8d144a1588d3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2022-07-22 15:23:04 +02:00
parent 96d0f86552
commit 43bf516d10

View File

@@ -406,8 +406,12 @@ void ModelPrivate::notifyNodeInstanceViewLast(Callable call)
}
for (const QPointer<AbstractView> &view : enabledViews()) {
if (!view->isBlockingNotifications())
call(view.data());
try {
if (!view->isBlockingNotifications())
call(view.data());
} catch (const Exception &e) {
e.showException(tr("Exception thrown by view %1.").arg(view->widgetInfo().tabName));
}
}
if (nodeInstanceView() && !nodeInstanceView()->isBlockingNotifications())