forked from qt-creator/qt-creator
Make C++ code style configurable.
Change-Id: Iaf08edb2361146e6b5e1cbafdb716a23c938875b Done-with: Jarek Kobus Task-number: QTCREATORBUG-2670 Task-number: QTCREATORBUG-4310 Task-number: QTCREATORBUG-2763 Task-number: QTCREATORBUG-3623 Task-number: QTCREATORBUG-567 Reviewed-on: http://codereview.qt.nokia.com/74 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -36,7 +36,6 @@
|
||||
#include "cpphighlighter.h"
|
||||
#include "cppchecksymbols.h"
|
||||
#include "cpplocalsymbols.h"
|
||||
#include "cppqtstyleindenter.h"
|
||||
#include "cppautocompleter.h"
|
||||
#include "cppquickfixassistant.h"
|
||||
|
||||
@@ -66,6 +65,8 @@
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cpptools/cppcodeformatter.h>
|
||||
#include <cpptools/cppcompletionassist.h>
|
||||
#include <cpptools/cppqtstyleindenter.h>
|
||||
#include <cpptools/cppcodestylesettings.h>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
@@ -423,7 +424,7 @@ CPPEditorWidget::CPPEditorWidget(QWidget *parent)
|
||||
setParenthesesMatchingEnabled(true);
|
||||
setMarksVisible(true);
|
||||
setCodeFoldingSupported(true);
|
||||
setIndenter(new CppQtStyleIndenter);
|
||||
setIndenter(new CppTools::CppQtStyleIndenter);
|
||||
setAutoCompleter(new CppAutoCompleter);
|
||||
|
||||
baseTextDocument()->setSyntaxHighlighter(new CppHighlighter);
|
||||
@@ -1814,6 +1815,12 @@ void CPPEditorWidget::unCommentSelection()
|
||||
Utils::unCommentSelection(this);
|
||||
}
|
||||
|
||||
void CPPEditorWidget::slotCodeStyleSettingsChanged(const QVariant &)
|
||||
{
|
||||
CppTools::QtStyleCodeFormatter formatter;
|
||||
formatter.invalidateCache(document());
|
||||
}
|
||||
|
||||
CPPEditorWidget::Link CPPEditorWidget::linkToSymbol(CPlusPlus::Symbol *symbol)
|
||||
{
|
||||
if (!symbol)
|
||||
|
||||
Reference in New Issue
Block a user