QmlDesigner: Write annotations if file is saved

Change-Id: I729205715493f65b83e2de6f09d3d968187afe7a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2018-04-12 17:04:52 +02:00
parent e0ce44cc27
commit 963ffb1096

View File

@@ -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)