Skip to content

Commit 5b07901

Browse files
committed
GUI: Add C++20 option
1 parent fe04c15 commit 5b07901

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

gui/checkthread.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ void CheckThread::runAddonsAndTools(const ImportProject::FileSettings *fileSetti
173173
case Standards::CPP17:
174174
args << "-std=c++17";
175175
break;
176+
case Standards::CPP20:
177+
args << "-std=c++20";
178+
break;
176179
};
177180
}
178181

gui/mainwindow.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
210210
mUI.mActionCpp11->setActionGroup(mCppStandardActions);
211211
mUI.mActionCpp14->setActionGroup(mCppStandardActions);
212212
mUI.mActionCpp17->setActionGroup(mCppStandardActions);
213+
mUI.mActionCpp20->setActionGroup(mCppStandardActions);
213214

214215
mUI.mActionEnforceC->setActionGroup(mSelectLanguageActions);
215216
mUI.mActionEnforceCpp->setActionGroup(mSelectLanguageActions);
@@ -294,6 +295,7 @@ void MainWindow::loadSettings()
294295
mUI.mActionCpp11->setChecked(standards.cpp == Standards::CPP11);
295296
mUI.mActionCpp14->setChecked(standards.cpp == Standards::CPP14);
296297
mUI.mActionCpp17->setChecked(standards.cpp == Standards::CPP17);
298+
mUI.mActionCpp20->setChecked(standards.cpp == Standards::CPP20);
297299

298300
// Main window settings
299301
const bool showMainToolbar = mSettings->value(SETTINGS_TOOLBARS_MAIN_SHOW, true).toBool();
@@ -372,6 +374,8 @@ void MainWindow::saveSettings() const
372374
mSettings->setValue(SETTINGS_STD_CPP, "C++14");
373375
if (mUI.mActionCpp17->isChecked())
374376
mSettings->setValue(SETTINGS_STD_CPP, "C++17");
377+
if (mUI.mActionCpp20->isChecked())
378+
mSettings->setValue(SETTINGS_STD_CPP, "C++20");
375379

376380
// Main window settings
377381
mSettings->setValue(SETTINGS_TOOLBARS_MAIN_SHOW, mUI.mToolBarMain->isVisible());

gui/mainwindow.ui

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
<addaction name="mActionCpp11"/>
139139
<addaction name="mActionCpp14"/>
140140
<addaction name="mActionCpp17"/>
141+
<addaction name="mActionCpp20"/>
141142
</widget>
142143
<widget class="QMenu" name="menuC_standard">
143144
<property name="title">
@@ -789,7 +790,7 @@
789790
<bool>true</bool>
790791
</property>
791792
<property name="checked">
792-
<bool>true</bool>
793+
<bool>false</bool>
793794
</property>
794795
<property name="text">
795796
<string>C++14</string>
@@ -819,6 +820,17 @@
819820
<string>C++17</string>
820821
</property>
821822
</action>
823+
<action name="mActionCpp20">
824+
<property name="checkable">
825+
<bool>true</bool>
826+
</property>
827+
<property name="checked">
828+
<bool>true</bool>
829+
</property>
830+
<property name="text">
831+
<string>C++20</string>
832+
</property>
833+
</action>
822834
</widget>
823835
<customwidgets>
824836
<customwidget>

0 commit comments

Comments
 (0)