diff --git a/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialog.qml b/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialog.qml index 131ae6cee99..53eaad0adf4 100644 --- a/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialog.qml +++ b/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialog.qml @@ -43,7 +43,7 @@ PopupDialog { Connections { target: root.backend - function onPopupTargetRemoved() { + function onPopupShouldClose() { root.close() } } diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp b/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp index c0b819371a8..54965013a44 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.cpp @@ -493,7 +493,7 @@ void ConnectionModel::nodeAboutToBeRemoved(const ModelNode &removedNode) if (selectedSignal.isValid()) { ModelNode targetNode = getTargetNodeForConnection(selectedSignal.parentModelNode()); if (targetNode == removedNode) { - emit m_delegate->popupTargetRemoved(); + emit m_delegate->popupShouldClose(); } } } @@ -2103,4 +2103,9 @@ ConnectionEditorStatements::ComparativeStatement ConditionListModel::toStatement return {}; } +void QmlDesigner::ConnectionModel::modelAboutToBeDetached() +{ + emit m_delegate->popupShouldClose(); +} + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.h b/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.h index d9b13cb22d2..d25d5aa2d3b 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.h +++ b/src/plugins/qmldesigner/components/connectioneditor/connectionmodel.h @@ -72,6 +72,7 @@ public: void selectProperty(const SignalHandlerProperty &property); void nodeAboutToBeRemoved(const ModelNode &removedNode); + void modelAboutToBeDetached(); signals: void currentIndexChanged(); @@ -298,7 +299,7 @@ signals: void hasConditionChanged(); void hasElseChanged(); void sourceChanged(); - void popupTargetRemoved(); + void popupShouldClose(); private: int currentRow() const; diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionview.cpp b/src/plugins/qmldesigner/components/connectioneditor/connectionview.cpp index 0b02ee0e34b..b96afd69665 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectionview.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/connectionview.cpp @@ -169,6 +169,7 @@ void ConnectionView::modelAboutToBeDetached(Model *model) bindingModel()->reset(); dynamicPropertiesModel()->reset(); connectionModel()->resetModel(); + connectionModel()->modelAboutToBeDetached(); } void ConnectionView::nodeCreated(const ModelNode & /*createdNode*/)