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

Method changePreset

Modules/QtWidgets/src/QmitkLevelWindowPresetDefinitionDialog.cpp:109–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void QmitkLevelWindowPresetDefinitionDialog::changePreset()
110{
111 QModelIndex index(m_SortModel.mapToSource(m_Controls->presetView->selectionModel()->currentIndex()));
112
113 if (!index.isValid())
114 return;
115
116 std::string name(m_Controls->presetnameLineEdit->text().toStdString());
117 if (name == "")
118 {
119 QMessageBox::critical(this,
120 "Preset definition",
121 "Presetname has to be set.\n"
122 "You have to enter a Presetname.");
123 }
124 else if (m_TableModel->contains(name) &&
125 (m_TableModel->getPreset(index).name != name))
126 {
127 QMessageBox::critical(this,
128 "Preset definition",
129 "Presetname already exists.\n"
130 "You have to enter another one.");
131 }
132 else
133 {
134 m_TableModel->changePreset(index.row(), name, m_Controls->levelSpinBox->value(), m_Controls->windowSpinBox->value());
135 }
136}
137
138void QmitkLevelWindowPresetDefinitionDialog::setPresets(std::map<std::string, double> &level,
139 std::map<std::string, double> &window,

Callers

nothing calls this directly

Calls 6

mapToSourceMethod · 0.80
textMethod · 0.80
containsMethod · 0.80
getPresetMethod · 0.80
rowMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected