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:
Christian Kamm
2011-02-03 15:48:14 +01:00
parent f69eb52944
commit 779fafcbfe
87 changed files with 5036 additions and 979 deletions

View File

@@ -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)