forked from qt-creator/qt-creator
ClangFormat: Move ClangFormat settings page
- Move ClangFormat settings page to TabWidget in the dialog that opens when a user press "Edit" button in the CodeStyle tab Change-Id: Ibd285344f07a6b2b20e275f2134976c50f91a019 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -75,25 +75,19 @@ namespace ClangFormat {
|
||||
|
||||
class ClangFormatStyleFactory : public CppEditor::CppCodeStylePreferencesFactory
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(ClangFormatStyleFactory)
|
||||
public:
|
||||
TextEditor::CodeStyleEditorWidget *createCodeStyleEditor(
|
||||
TextEditor::ICodeStylePreferences *preferences, QWidget *parent) override
|
||||
{
|
||||
Q_UNUSED(preferences);
|
||||
if (!parent)
|
||||
return new ClangFormatConfigWidget;
|
||||
return new ClangFormatConfigWidget(SessionManager::startupProject());
|
||||
}
|
||||
|
||||
QWidget *createEditor(TextEditor::ICodeStylePreferences *, QWidget *) const override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TextEditor::Indenter *createIndenter(QTextDocument *doc) const override
|
||||
{
|
||||
return new ClangFormatIndenter(doc);
|
||||
}
|
||||
|
||||
std::pair<QWidget *, QString> additionalTab(QWidget *parent) const override
|
||||
{
|
||||
if (!parent)
|
||||
return {new ClangFormatConfigWidget(), tr("ClangFormat")};
|
||||
return {new ClangFormatConfigWidget(SessionManager::startupProject()), tr("ClangFormat")};
|
||||
}
|
||||
};
|
||||
|
||||
static void replaceCppCodeStyle()
|
||||
|
||||
Reference in New Issue
Block a user