forked from qt-creator/qt-creator
CppEditor: Move indenter construction to document constructor
A more direct approach than going through the widget's baseTextDocument, relying on widget life time. Change-Id: I62c10e53b1a9a1e6717c6eb3e3cc78dcbfd2868e Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "cpphighlighter.h"
|
||||
|
||||
#include <cpptools/cppcodeformatter.h>
|
||||
#include <cpptools/cppqtstyleindenter.h>
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
|
||||
#include <QTextDocument>
|
||||
@@ -48,6 +49,7 @@ CPPEditorDocument::CPPEditorDocument()
|
||||
connect(this, SIGNAL(mimeTypeChanged()),
|
||||
this, SLOT(onMimeTypeChanged()));
|
||||
setSyntaxHighlighter(new CppHighlighter);
|
||||
setIndenter(new CppTools::CppQtStyleIndenter);
|
||||
onMimeTypeChanged();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user