forked from qt-creator/qt-creator
Generic highlighter: Making highlighting available for desinger XML editor.
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <texteditor/basetextdocument.h>
|
||||
#include <texteditor/plaintexteditor.h>
|
||||
|
||||
@@ -82,6 +83,7 @@ FormWindowEditor::FormWindowEditor(Internal::DesignerXmlEditor *editor,
|
||||
// Force update of open editors model.
|
||||
connect(&(d->m_file), SIGNAL(saved()), this, SIGNAL(changed()));
|
||||
connect(&(d->m_file), SIGNAL(changed()), this, SIGNAL(changed()));
|
||||
connect(this, SIGNAL(changed()), this, SLOT(configureXmlEditor()));
|
||||
}
|
||||
|
||||
FormWindowEditor::~FormWindowEditor()
|
||||
@@ -164,6 +166,15 @@ void FormWindowEditor::syncXmlEditor()
|
||||
syncXmlEditor(contents());
|
||||
}
|
||||
|
||||
void FormWindowEditor::configureXmlEditor() const
|
||||
{
|
||||
TextEditor::PlainTextEditor *editor =
|
||||
qobject_cast<TextEditor::PlainTextEditor *>(d->m_textEditable.editor());
|
||||
if (editor)
|
||||
editor->configure(Core::ICore::instance()->mimeDatabase()->findByFile(
|
||||
d->m_file.fileName()));
|
||||
}
|
||||
|
||||
void FormWindowEditor::syncXmlEditor(const QString &contents)
|
||||
{
|
||||
d->m_textEditable.editor()->setPlainText(contents);
|
||||
|
||||
Reference in New Issue
Block a user