diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp index b4a1bdabdbb..d4fd3b0147f 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp @@ -552,6 +552,16 @@ void DesignDocument::setEditor(Core::IEditor *editor) { m_textEditor = editor; // if the user closed the file explicit we do not want to do anything with it anymore + + + connect(Core::EditorManager::instance(), &Core::EditorManager::aboutToSave, + this, [this](Core::IDocument *document) { + if (m_textEditor && m_textEditor->document() == document) { + if (m_documentModel && m_documentModel->rewriterView()) + m_documentModel->rewriterView()->writeAuxiliaryData(); + } + }); + connect(Core::EditorManager::instance(), &Core::EditorManager::editorAboutToClose, this, [this](Core::IEditor *editor) { if (m_textEditor.data() == editor)