QmlDesigner: Catch exception

Change-Id: I22db80a0d6e7a1c95f6e77f584a177aaa78253bf
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2019-02-04 11:26:32 +01:00
parent d4726589f1
commit 2c583d6c98

View File

@@ -25,6 +25,7 @@
#include "pathitem.h" #include "pathitem.h"
#include <exception.h>
#include <nodeproperty.h> #include <nodeproperty.h>
#include <variantproperty.h> #include <variantproperty.h>
#include <nodelistproperty.h> #include <nodelistproperty.h>
@@ -840,6 +841,7 @@ void PathItem::updatePathModelNodes(const QList<SelectionPoint> &changedPoints)
{ {
PathUpdateDisabler pathUpdateDisabler(this, PathUpdateDisabler::DontUpdatePath); PathUpdateDisabler pathUpdateDisabler(this, PathUpdateDisabler::DontUpdatePath);
try {
RewriterTransaction rewriterTransaction = RewriterTransaction rewriterTransaction =
formEditorItem()->qmlItemNode().view()->beginRewriterTransaction(QByteArrayLiteral("PathItem::createCubicSegmentContextMenu")); formEditorItem()->qmlItemNode().view()->beginRewriterTransaction(QByteArrayLiteral("PathItem::createCubicSegmentContextMenu"));
@@ -847,6 +849,9 @@ void PathItem::updatePathModelNodes(const QList<SelectionPoint> &changedPoints)
changedPoint.controlPoint.updateModelNode(); changedPoint.controlPoint.updateModelNode();
rewriterTransaction.commit(); rewriterTransaction.commit();
} catch (const Exception &e) {
e.showException();
}
} }
void PathItem::disablePathUpdates() void PathItem::disablePathUpdates()