From 963ffb1096827a0bc9c0bc4d4c9e16a9e7ab85cd Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 12 Apr 2018 17:04:52 +0200 Subject: [PATCH] QmlDesigner: Write annotations if file is saved Change-Id: I729205715493f65b83e2de6f09d3d968187afe7a Reviewed-by: Tim Jenssen --- .../components/integration/designdocument.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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)