Commit 7b73ff7f authored by hjk's avatar hjk

Designer: Remove use of xml editor() link by storing the pointer on creation

Change-Id: I10b8f36a2a30997ef0ebb7ae6a7391af77664b92
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 93b659e9
......@@ -42,8 +42,8 @@ DesignerXmlEditorWidget::DesignerXmlEditorWidget(QDesignerFormWindowInterface *f
{
TextEditor::BaseTextDocumentPtr doc(new FormWindowFile(form));
setTextDocument(doc);
auto editor = new FormWindowEditor(this);
editor->setEditorWidget(this);
m_editor = new FormWindowEditor(this);
m_editor->setEditorWidget(this);
setupAsPlainEditor();
setReadOnly(true);
configureMimeType(doc->mimeType());
......@@ -51,7 +51,7 @@ DesignerXmlEditorWidget::DesignerXmlEditorWidget(QDesignerFormWindowInterface *f
FormWindowEditor *DesignerXmlEditorWidget::designerEditor() const
{
return qobject_cast<FormWindowEditor *>(editor());
return m_editor;
}
Internal::FormWindowFile *DesignerXmlEditorWidget::formWindowFile() const
......
......@@ -61,6 +61,9 @@ public:
FormWindowEditor *designerEditor() const;
Internal::FormWindowFile *formWindowFile() const;
private:
FormWindowEditor *m_editor;
};
} // Internal
......
......@@ -641,7 +641,7 @@ EditorData FormEditorW::createEditor()
resourceHandler, SLOT(updateResources()));
m_editorWidget->add(data);
m_toolBar->addEditor(xmlEditor->editor());
m_toolBar->addEditor(xmlEditor->designerEditor());
return data;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment