QmlDesigner: Clear errors when starting the puppet

Change-Id: I25d163ae48d094d6e7ba5059f7832d1b48ffec65
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2022-03-17 17:48:43 +01:00
parent 8867fd2a9b
commit 44f7bf09b5
2 changed files with 13 additions and 2 deletions

View File

@@ -170,6 +170,8 @@ private: // functions
NodeInstance loadNode(const ModelNode &node); NodeInstance loadNode(const ModelNode &node);
void clearErrors();
void removeAllInstanceNodeRelationships(); void removeAllInstanceNodeRelationships();
void removeRecursiveChildRelationship(const ModelNode &removedNode); void removeRecursiveChildRelationship(const ModelNode &removedNode);

View File

@@ -326,10 +326,17 @@ void NodeInstanceView::endPuppetTransaction()
} }
} }
void NodeInstanceView::clearErrors()
{
for (NodeInstance &instance : instances()) {
instance.setError({});
}
}
void NodeInstanceView::restartProcess() void NodeInstanceView::restartProcess()
{ {
if (rootNodeInstance().isValid()) clearErrors();
rootNodeInstance().setError({});
emitInstanceErrorChange({}); emitInstanceErrorChange({});
emitDocumentMessage({}, {}); emitDocumentMessage({}, {});
@@ -958,6 +965,8 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand()
} }
} }
clearErrors();
nodeList = filterNodesForSkipItems(nodeList); nodeList = filterNodesForSkipItems(nodeList);
QList<VariantProperty> variantPropertyList; QList<VariantProperty> variantPropertyList;