summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-08-21 08:49:56 +0200
committerhjk <hjk121@nokiamail.com>2014-08-21 14:00:28 +0200
commit8213a88d3e6a3cb0952918095e5ee6543f8fd6a3 (patch)
tree68778c130cb950225caab23dfcf9d4f3d8c968e9 /src
parente560ef82ef71c30d0eb78f05940011cac0534ddd (diff)
downloadqt-creator-8213a88d3e6a3cb0952918095e5ee6543f8fd6a3.tar.gz
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: Christian Stenger <christian.stenger@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/designer/designerxmleditorwidget.cpp12
-rw-r--r--src/plugins/designer/designerxmleditorwidget.h3
2 files changed, 6 insertions, 9 deletions
diff --git a/src/plugins/designer/designerxmleditorwidget.cpp b/src/plugins/designer/designerxmleditorwidget.cpp
index a3357ead0c..b5fa519690 100644
--- a/src/plugins/designer/designerxmleditorwidget.cpp
+++ b/src/plugins/designer/designerxmleditorwidget.cpp
@@ -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
diff --git a/src/plugins/designer/designerxmleditorwidget.h b/src/plugins/designer/designerxmleditorwidget.h
index 975510b807..498be05003 100644
--- a/src/plugins/designer/designerxmleditorwidget.h
+++ b/src/plugins/designer/designerxmleditorwidget.h
@@ -64,9 +64,6 @@ public:
protected:
virtual TextEditor::BaseTextEditor *createEditor();
-
-private:
- FormWindowEditor *m_designerEditor;
};
} // Internal