Commit 8213a88d authored by hjk's avatar hjk

Designer: Move DesignerXmlEditorWidget creation closer to new setup

Not yet the precise setup, but good enough for a non-duplicatable
editor.

Change-Id: I2c8156fef73985457aab61d72b853a9b3f604cbc
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent e560ef82
......@@ -29,7 +29,8 @@
#include "designerxmleditorwidget.h"
#include "formwindoweditor.h"
#include "designerconstants.h"
#include <utils/qtcassert.h>
#include <QDesignerFormWindowInterface>
#include <QDebug>
......@@ -41,7 +42,8 @@ DesignerXmlEditorWidget::DesignerXmlEditorWidget(QDesignerFormWindowInterface *f
{
TextEditor::BaseTextDocumentPtr doc(new FormWindowFile(form));
setTextDocument(doc);
m_designerEditor = new FormWindowEditor(this);
auto editor = new FormWindowEditor(this);
editor->setEditorWidget(this);
setupAsPlainEditor();
setReadOnly(true);
configureMimeType(doc->mimeType());
......@@ -49,14 +51,12 @@ DesignerXmlEditorWidget::DesignerXmlEditorWidget(QDesignerFormWindowInterface *f
TextEditor::BaseTextEditor *DesignerXmlEditorWidget::createEditor()
{
if (Designer::Constants::Internal::debug)
qDebug() << "DesignerXmlEditor::createEditableInterface()";
return m_designerEditor;
QTC_ASSERT("should not happen anymore" && false, return 0);
}
FormWindowEditor *DesignerXmlEditorWidget::designerEditor() const
{
return m_designerEditor;
return qobject_cast<FormWindowEditor *>(editor());
}
Internal::FormWindowFile *DesignerXmlEditorWidget::formWindowFile() const
......
......@@ -64,9 +64,6 @@ public:
protected:
virtual TextEditor::BaseTextEditor *createEditor();
private:
FormWindowEditor *m_designerEditor;
};
} // Internal
......
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