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:
45
src/plugins/cpptools/cppcodestylesettingsfactory.cpp
Normal file
45
src/plugins/cpptools/cppcodestylesettingsfactory.cpp
Normal 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user