diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2019-01-14 01:40:53 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2019-01-21 09:00:18 +0000 |
commit | 1d3d18a96988eb091b207103f18c9fbba505013a (patch) | |
tree | ea96a5524d5dbda96447455a9152484e54ea6e3b /src/plugins/cpptools/cppcodestylesettingspage.cpp | |
parent | 845af928896ba1ef1bb7259766913ea7f4c35cd9 (diff) | |
download | qt-creator-1d3d18a96988eb091b207103f18c9fbba505013a.tar.gz |
CppTools: modernize
Change-Id: Iaf02e4d026f1ac8b216833d83cd7a735e21ff60a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/cpptools/cppcodestylesettingspage.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcodestylesettingspage.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/plugins/cpptools/cppcodestylesettingspage.cpp b/src/plugins/cpptools/cppcodestylesettingspage.cpp index 26a0edaa6f..c80537db9b 100644 --- a/src/plugins/cpptools/cppcodestylesettingspage.cpp +++ b/src/plugins/cpptools/cppcodestylesettingspage.cpp @@ -224,7 +224,7 @@ static void applyRefactorings(QTextDocument *textDocument, TextEditorWidget *edi { // Preprocess source Environment env; - Preprocessor preprocess(0, &env); + Preprocessor preprocess(nullptr, &env); const QByteArray preprocessedSource = preprocess.run(QLatin1String("<no-file>"), textDocument->toPlainText()); @@ -238,7 +238,7 @@ static void applyRefactorings(QTextDocument *textDocument, TextEditorWidget *edi // Run the formatter Overview overview; overview.showReturnTypes = true; - overview.starBindFlags = Overview::StarBindFlags(0); + overview.starBindFlags = Overview::StarBindFlags(nullptr); if (settings.bindStarToIdentifier) overview.starBindFlags |= Overview::BindToIdentifier; @@ -261,9 +261,7 @@ static void applyRefactorings(QTextDocument *textDocument, TextEditorWidget *edi CppCodeStylePreferencesWidget::CppCodeStylePreferencesWidget(QWidget *parent) : QWidget(parent), - m_preferences(0), - m_ui(new Ui::CppCodeStyleSettingsPage), - m_blockUpdates(false) + m_ui(new Ui::CppCodeStyleSettingsPage) { m_ui->setupUi(this); m_ui->categoryTab->setProperty("_q_custom_style_disabled", true); @@ -442,7 +440,7 @@ void CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged() return; if (m_preferences) { - CppCodeStylePreferences *current = qobject_cast<CppCodeStylePreferences *>(m_preferences->currentPreferences()); + auto current = qobject_cast<CppCodeStylePreferences *>(m_preferences->currentPreferences()); if (current) current->setCodeStyleSettings(cppCodeStyleSettings()); } @@ -456,7 +454,7 @@ void CppCodeStylePreferencesWidget::slotTabSettingsChanged(const TabSettings &se return; if (m_preferences) { - CppCodeStylePreferences *current = qobject_cast<CppCodeStylePreferences *>(m_preferences->currentPreferences()); + auto current = qobject_cast<CppCodeStylePreferences *>(m_preferences->currentPreferences()); if (current) current->setTabSettings(settings); } @@ -512,9 +510,8 @@ void CppCodeStylePreferencesWidget::setVisualizeWhitespace(bool on) // ------------------ CppCodeStyleSettingsPage -CppCodeStyleSettingsPage::CppCodeStyleSettingsPage(QWidget *parent) : - Core::IOptionsPage(parent), - m_pageCppCodeStylePreferences(0) +CppCodeStyleSettingsPage::CppCodeStyleSettingsPage(QWidget *parent) + : Core::IOptionsPage(parent) { setId(Constants::CPP_CODE_STYLE_SETTINGS_ID); setDisplayName(QCoreApplication::translate("CppTools", Constants::CPP_CODE_STYLE_SETTINGS_NAME)); |