ClangFormat: Synchronize ClangFormat settings with CppEditor codestyle

Added synchronization between ClangFormat codestyle settings and
CppEditors codestyle settings. All changes which will be done in
ClangFormat settings tab settings tabs will be automatically
retranslated to CppEditor codestyle settings tabs and vice versa.

Change-Id: I408d726c12552856e3c1b72d3ba09b77fff83321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Artem Sokolovskii
2021-11-01 16:20:08 +01:00
parent 85b5a887e8
commit a997161dd6
11 changed files with 262 additions and 32 deletions

View File

@@ -105,13 +105,12 @@ QWidget *CppCodeStylePreferencesFactory::createEditor(TextEditor::ICodeStylePref
return nullptr;
auto widget = new Internal::CppCodeStylePreferencesWidget(parent);
const auto tab = additionalTab(parent);
if (tab.first) {
widget->addTab(tab.first, tab.second);
}
widget->layout()->setContentsMargins(0, 0, 0, 0);
widget->setCodeStyle(cppPreferences);
const auto tab = additionalTab(parent);
widget->addTab(tab.first, tab.second);
return widget;
}
@@ -130,7 +129,7 @@ QString CppCodeStylePreferencesFactory::previewText() const
return QLatin1String(defaultPreviewText);
}
std::pair<QWidget *, QString> CppCodeStylePreferencesFactory::additionalTab(QWidget *parent) const
std::pair<CppCodeStyleWidget *, QString> CppCodeStylePreferencesFactory::additionalTab(QWidget *parent) const
{
Q_UNUSED(parent)
return {nullptr, ""};