diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index 4a743ada92d..b89734d7567 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -145,7 +145,6 @@ SystemSettings::SystemSettings() Tr::tr("Allow crashes to be automatically reported. Collected reports are " "used for the sole purpose of fixing bugs.")); - showCrashButton.setSettingsKey("ShowCrashButton"); #endif readSettings(); @@ -239,9 +238,19 @@ public: .arg(appInfo().crashReports.toUserOutput()); m_clearCrashReportsButton->setToolTip(toolTip); m_crashReportsSizeText->setToolTip(toolTip); - grid.addRow( - {s.enableCrashReporting, - Row{m_clearCrashReportsButton, m_crashReportsSizeText, helpCrashReportingButton, st}}); + Row crashDetails + = Row{m_clearCrashReportsButton, m_crashReportsSizeText, helpCrashReportingButton, st}; + if (qtcEnvironmentVariableIsSet("QTC_SHOW_CRASHBUTTON")) { + auto crashButton = new QPushButton("CRASH!!!"); + connect(crashButton, &QPushButton::clicked, [] { + // do a real crash + volatile int *a = reinterpret_cast(NULL); + *a = 1; + }); + crashDetails.addItem(crashButton); + } + grid.addRow({s.enableCrashReporting, crashDetails}); + #endif Column { @@ -267,15 +276,6 @@ public: } #ifdef ENABLE_CRASHPAD - if (s.showCrashButton()) { - auto crashButton = new QPushButton("CRASH!!!"); - crashButton->show(); - connect(crashButton, &QPushButton::clicked, [] { - // do a real crash - volatile int* a = reinterpret_cast(NULL); *a = 1; - }); - } - connect(helpCrashReportingButton, &QAbstractButton::clicked, this, [this] { showHelpDialog(Tr::tr("Crash Reporting"), CorePlugin::msgCrashpadInformation()); }); diff --git a/src/plugins/coreplugin/systemsettings.h b/src/plugins/coreplugin/systemsettings.h index 1c4bdfc9e37..05c4d152a4f 100644 --- a/src/plugins/coreplugin/systemsettings.h +++ b/src/plugins/coreplugin/systemsettings.h @@ -33,7 +33,6 @@ public: #ifdef ENABLE_CRASHPAD Utils::BoolAspect enableCrashReporting{this}; - Utils::BoolAspect showCrashButton{this}; #endif Utils::BoolAspect askBeforeExit{this};