MCPcopy Create free account
hub / github.com/MITK/MITK / showEvent

Method showEvent

Plugins/org.mitk.gui.qt.ext/src/QmitkStartupDialog.cpp:206–227  ·  view source on GitHub ↗

Load presets and restore previous settings.

Source from the content-addressed store, hash-verified

204
205// Load presets and restore previous settings.
206void QmitkStartupDialog::showEvent(QShowEvent*)
207{
208 this->LoadPresets();
209
210 auto prefs = GetPreferences();
211 bool usePreset = prefs->GetBool("use preset", false);
212
213 if (usePreset)
214 {
215 m_Ui->presetRadioButton->setChecked(true);
216
217 QString preset = QString::fromStdString(prefs->Get("preset", ""));
218
219 if (preset.isEmpty())
220 return;
221
222 auto items = m_Ui->presetListWidget->findItems(preset, Qt::MatchExactly);
223
224 if (!items.isEmpty())
225 m_Ui->presetListWidget->setCurrentItem(items.first());
226 }
227}
228
229void QmitkStartupDialog::OnPresetRadioButtonToggled(bool checked)
230{

Callers

nothing calls this directly

Calls 4

LoadPresetsMethod · 0.95
GetBoolMethod · 0.80
GetPreferencesFunction · 0.70
GetMethod · 0.45

Tested by

no test coverage detected