forked from qt-creator/qt-creator
TextEditor: Use more direct approach for fallback IEditor construction
There are still a few places where the EditorWidget is the primary object, or several of them per "visible" IEditor (e.g. Diff). Provide a means to streamline setup there, too. Change-Id: I14cfbd68e555ebc539e707032a0e5bef563e0a36 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -49,15 +49,7 @@ namespace TextEditor {
|
||||
SnippetEditorWidget::SnippetEditorWidget(QWidget *parent)
|
||||
: BaseTextEditorWidget(parent)
|
||||
{
|
||||
setSimpleTextDocument(TextEditor::Constants::SNIPPET_EDITOR_ID);
|
||||
textDocument()->setFontSettings(TextEditorSettings::fontSettings());
|
||||
|
||||
// Should not be necessary in this case, but the base text editor
|
||||
// implementation assumes a valid associated editor.
|
||||
auto dummy = new BaseTextEditor;
|
||||
dummy->addContext(Constants::SNIPPET_EDITOR_ID);
|
||||
dummy->setEditorWidget(this);
|
||||
|
||||
setupFallBackEditor(TextEditor::Constants::SNIPPET_EDITOR_ID);
|
||||
setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
|
||||
setHighlightCurrentLine(false);
|
||||
setLineNumbersVisible(false);
|
||||
|
||||
Reference in New Issue
Block a user