From 93b1c18aeb01e801e6134f5f5809563aa9b75d24 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 20 Sep 2023 19:30:41 +0200 Subject: [PATCH] QmlDesigner: Remove ko statement if changing type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I28a0e796e3f3da0da584e1b8e58c8821f2777d61 Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Reviewed-by: Henning Gründl --- .../components/connectioneditor/connectionmodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp b/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp index 54965013a44..50ad727fe22 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp @@ -737,6 +737,11 @@ void ConnectionModelBackendDelegate::changeActionType(ActionType actionType) ConnectionEditorStatements::MatchedStatement &okStatement = ConnectionEditorStatements::okStatement(m_handler); + ConnectionEditorStatements::MatchedStatement &koStatement + = ConnectionEditorStatements::koStatement(m_handler); + + koStatement = ConnectionEditorStatements::EmptyBlock(); + //We expect a valid id on the root node const QString validId = model->connectionView()->rootModelNode().validId(); QString statementSource = generateDefaultStatement(actionType, validId);