core: make context and widget IContext data members

This commit is contained in:
hjk
2011-04-13 13:00:30 +02:00
parent cbfaea1ed3
commit 70d392d235
55 changed files with 135 additions and 490 deletions

View File

@@ -59,28 +59,25 @@ namespace Designer {
struct FormWindowEditorPrivate
{
explicit FormWindowEditorPrivate(Internal::DesignerXmlEditor *editor,
QDesignerFormWindowInterface *form);
FormWindowEditorPrivate(Internal::DesignerXmlEditor *editor,
QDesignerFormWindowInterface *form)
: m_textEditor(editor), m_file(form)
{}
TextEditor::PlainTextEditor m_textEditor;
Internal::FormWindowFile m_file;
Core::Context m_context;
};
FormWindowEditorPrivate::FormWindowEditorPrivate(Internal::DesignerXmlEditor *editor,
QDesignerFormWindowInterface *form) :
m_textEditor(editor), m_file(form)
{
}
FormWindowEditor::FormWindowEditor(Internal::DesignerXmlEditor *editor,
QDesignerFormWindowInterface *form,
QObject *parent) :
Core::IEditor(parent),
d(new FormWindowEditorPrivate(editor, form))
{
d->m_context.add(Designer::Constants::K_DESIGNER_XML_EDITOR_ID);
d->m_context.add(Designer::Constants::C_DESIGNER_XML_EDITOR);
setContext(Core::Context(Designer::Constants::K_DESIGNER_XML_EDITOR_ID,
Designer::Constants::C_DESIGNER_XML_EDITOR));
setWidget(d->m_textEditor.widget());
connect(form, SIGNAL(changed()), this, SIGNAL(changed()));
// Revert to saved/load externally modified files.
connect(&d->m_file, SIGNAL(reload(QString)), this, SLOT(slotOpen(QString)));
@@ -239,16 +236,6 @@ bool FormWindowEditor::restoreState(const QByteArray &state)
return d->m_textEditor.restoreState(state);
}
Core::Context FormWindowEditor::context() const
{
return d->m_context;
}
QWidget *FormWindowEditor::widget()
{
return d->m_textEditor.widget();
}
bool FormWindowEditor::isTemporary() const
{
return false;