forked from qt-creator/qt-creator
Clang: Clean up some names in ClangProjectSettingsWidget
Clarify some names and encode the widget type as suffix. Change-Id: Id0d3b3a3df16df60af806ad6aa60b0269a1bde0a Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -59,19 +59,19 @@ ClangProjectSettingsWidget::ClangProjectSettingsWidget(ProjectExplorer::Project
|
|||||||
|
|
||||||
using namespace CppTools;
|
using namespace CppTools;
|
||||||
|
|
||||||
m_ui.delayedTemplateParse->setVisible(Utils::HostOsInfo::isWindowsHost());
|
m_ui.delayedTemplateParseCheckBox->setVisible(Utils::HostOsInfo::isWindowsHost());
|
||||||
|
|
||||||
m_ui.clangSettings->setCurrentIndex(m_projectSettings.useGlobalConfig() ? 0 : 1);
|
m_ui.globalOrCustomComboBox->setCurrentIndex(m_projectSettings.useGlobalConfig() ? 0 : 1);
|
||||||
|
|
||||||
connect(m_ui.clangDiagnosticConfigsSelectionWidget,
|
connect(m_ui.clangDiagnosticConfigsSelectionWidget,
|
||||||
&ClangDiagnosticConfigsSelectionWidget::currentConfigChanged,
|
&ClangDiagnosticConfigsSelectionWidget::currentConfigChanged,
|
||||||
this, &ClangProjectSettingsWidget::onCurrentWarningConfigChanged);
|
this, &ClangProjectSettingsWidget::onCurrentWarningConfigChanged);
|
||||||
|
|
||||||
connect(m_ui.delayedTemplateParse, &QCheckBox::toggled,
|
connect(m_ui.delayedTemplateParseCheckBox, &QCheckBox::toggled,
|
||||||
this, &ClangProjectSettingsWidget::onDelayedTemplateParseClicked);
|
this, &ClangProjectSettingsWidget::onDelayedTemplateParseClicked);
|
||||||
connect(m_ui.clangSettings,
|
connect(m_ui.globalOrCustomComboBox,
|
||||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
this, &ClangProjectSettingsWidget::onClangSettingsChanged);
|
this, &ClangProjectSettingsWidget::onGlobalCustomChanged);
|
||||||
connect(project, &ProjectExplorer::Project::aboutToSaveSettings,
|
connect(project, &ProjectExplorer::Project::aboutToSaveSettings,
|
||||||
this, &ClangProjectSettingsWidget::onAboutToSaveProjectSettings);
|
this, &ClangProjectSettingsWidget::onAboutToSaveProjectSettings);
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ void ClangProjectSettingsWidget::onDelayedTemplateParseClicked(bool checked)
|
|||||||
m_projectSettings.setCommandLineOptions(options);
|
m_projectSettings.setCommandLineOptions(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangProjectSettingsWidget::onClangSettingsChanged(int index)
|
void ClangProjectSettingsWidget::onGlobalCustomChanged(int index)
|
||||||
{
|
{
|
||||||
m_projectSettings.setUseGlobalConfig(index == 0 ? true : false);
|
m_projectSettings.setUseGlobalConfig(index == 0 ? true : false);
|
||||||
syncOtherWidgetsToComboBox();
|
syncOtherWidgetsToComboBox();
|
||||||
@@ -118,11 +118,11 @@ void ClangProjectSettingsWidget::onAboutToSaveProjectSettings()
|
|||||||
void ClangProjectSettingsWidget::syncOtherWidgetsToComboBox()
|
void ClangProjectSettingsWidget::syncOtherWidgetsToComboBox()
|
||||||
{
|
{
|
||||||
const QStringList options = m_projectSettings.commandLineOptions();
|
const QStringList options = m_projectSettings.commandLineOptions();
|
||||||
m_ui.delayedTemplateParse->setChecked(
|
m_ui.delayedTemplateParseCheckBox->setChecked(
|
||||||
options.contains(QLatin1String{ClangProjectSettings::DelayedTemplateParsing}));
|
options.contains(QLatin1String{ClangProjectSettings::DelayedTemplateParsing}));
|
||||||
|
|
||||||
const bool isCustom = !m_projectSettings.useGlobalConfig();
|
const bool isCustom = !m_projectSettings.useGlobalConfig();
|
||||||
m_ui.delayedTemplateParse->setEnabled(isCustom);
|
m_ui.delayedTemplateParseCheckBox->setEnabled(isCustom);
|
||||||
|
|
||||||
for (int i = 0; i < m_ui.clangDiagnosticConfigsSelectionWidget->layout()->count(); ++i) {
|
for (int i = 0; i < m_ui.clangDiagnosticConfigsSelectionWidget->layout()->count(); ++i) {
|
||||||
QWidget *widget = m_ui.clangDiagnosticConfigsSelectionWidget->layout()->itemAt(i)->widget();
|
QWidget *widget = m_ui.clangDiagnosticConfigsSelectionWidget->layout()->itemAt(i)->widget();
|
||||||
|
@@ -46,7 +46,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void onCurrentWarningConfigChanged(const Core::Id ¤tConfigId);
|
void onCurrentWarningConfigChanged(const Core::Id ¤tConfigId);
|
||||||
void onDelayedTemplateParseClicked(bool);
|
void onDelayedTemplateParseClicked(bool);
|
||||||
void onClangSettingsChanged(int index);
|
void onGlobalCustomChanged(int index);
|
||||||
void onAboutToSaveProjectSettings();
|
void onAboutToSaveProjectSettings();
|
||||||
void syncOtherWidgetsToComboBox();
|
void syncOtherWidgetsToComboBox();
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="clangSettings">
|
<widget class="QComboBox" name="globalOrCustomComboBox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="delayedTemplateParse">
|
<widget class="QCheckBox" name="delayedTemplateParseCheckBox">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Parse templates in a MSVC-compliant way. This helps to parse headers for example from Active Template Library (ATL) or Windows Runtime Library (WRL).
|
<string>Parse templates in a MSVC-compliant way. This helps to parse headers for example from Active Template Library (ATL) or Windows Runtime Library (WRL).
|
||||||
However, using the relaxed and extended rules means also that no highlighting/completion can be provided within template functions.</string>
|
However, using the relaxed and extended rules means also that no highlighting/completion can be provided within template functions.</string>
|
||||||
|
Reference in New Issue
Block a user