GUI: Add C++20 option

This commit is contained in:
Daniel Marjamäki 2019-05-05 10:44:09 +02:00
parent fe04c15c9e
commit 5b07901253
3 changed files with 20 additions and 1 deletions

View File

@ -173,6 +173,9 @@ void CheckThread::runAddonsAndTools(const ImportProject::FileSettings *fileSetti
case Standards::CPP17:
args << "-std=c++17";
break;
case Standards::CPP20:
args << "-std=c++20";
break;
};
}

View File

@ -210,6 +210,7 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
mUI.mActionCpp11->setActionGroup(mCppStandardActions);
mUI.mActionCpp14->setActionGroup(mCppStandardActions);
mUI.mActionCpp17->setActionGroup(mCppStandardActions);
mUI.mActionCpp20->setActionGroup(mCppStandardActions);
mUI.mActionEnforceC->setActionGroup(mSelectLanguageActions);
mUI.mActionEnforceCpp->setActionGroup(mSelectLanguageActions);
@ -294,6 +295,7 @@ void MainWindow::loadSettings()
mUI.mActionCpp11->setChecked(standards.cpp == Standards::CPP11);
mUI.mActionCpp14->setChecked(standards.cpp == Standards::CPP14);
mUI.mActionCpp17->setChecked(standards.cpp == Standards::CPP17);
mUI.mActionCpp20->setChecked(standards.cpp == Standards::CPP20);
// Main window settings
const bool showMainToolbar = mSettings->value(SETTINGS_TOOLBARS_MAIN_SHOW, true).toBool();
@ -372,6 +374,8 @@ void MainWindow::saveSettings() const
mSettings->setValue(SETTINGS_STD_CPP, "C++14");
if (mUI.mActionCpp17->isChecked())
mSettings->setValue(SETTINGS_STD_CPP, "C++17");
if (mUI.mActionCpp20->isChecked())
mSettings->setValue(SETTINGS_STD_CPP, "C++20");
// Main window settings
mSettings->setValue(SETTINGS_TOOLBARS_MAIN_SHOW, mUI.mToolBarMain->isVisible());

View File

@ -138,6 +138,7 @@
<addaction name="mActionCpp11"/>
<addaction name="mActionCpp14"/>
<addaction name="mActionCpp17"/>
<addaction name="mActionCpp20"/>
</widget>
<widget class="QMenu" name="menuC_standard">
<property name="title">
@ -789,7 +790,7 @@
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="text">
<string>C++14</string>
@ -819,6 +820,17 @@
<string>C++17</string>
</property>
</action>
<action name="mActionCpp20">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>C++20</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>