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

@@ -0,0 +1,45 @@
#include "cppcodestylesettingsfactory.h"
#include "cppcodestylesettings.h"
#include "cppcodestylesettingspage.h"
#include "cppcodestylepreferences.h"
#include "cpptoolsconstants.h"
#include <texteditor/tabpreferences.h>
#include <texteditor/tabsettings.h>
#include <QtGui/QLayout>
using namespace CppTools;
CppCodeStylePreferencesFactory::CppCodeStylePreferencesFactory()
{
}
QString CppCodeStylePreferencesFactory::languageId()
{
return Constants::CPP_SETTINGS_ID;
}
QString CppCodeStylePreferencesFactory::displayName()
{
return Constants::CPP_SETTINGS_NAME;
}
TextEditor::IFallbackPreferences *CppCodeStylePreferencesFactory::createPreferences(
const QList<TextEditor::IFallbackPreferences *> &fallbacks) const
{
return new CppCodeStylePreferences(fallbacks);
}
QWidget *CppCodeStylePreferencesFactory::createEditor(TextEditor::IFallbackPreferences *preferences,
TextEditor::TabPreferences *tabPreferences,
QWidget *parent) const
{
CppCodeStylePreferences *cppPreferences = qobject_cast<CppCodeStylePreferences *>(preferences);
if (!cppPreferences)
return 0;
Internal::CppCodeStylePreferencesWidget *widget = new Internal::CppCodeStylePreferencesWidget(parent);
widget->layout()->setMargin(0);
widget->setCppCodeStylePreferences(cppPreferences);
widget->setTabPreferences(tabPreferences);
return widget;
}