MCPcopy Create free account
hub / github.com/IENT/YUView / done

Method done

YUViewLib/src/ui/StatisticsStyleControl_ColorMapEditor.cpp:211–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211void StatisticsStyleControl_ColorMapEditor::done(int r)
212{
213 if (r != QDialog::Accepted)
214 {
215 QDialog::done(r);
216 return;
217 }
218
219 bool dublicates = false;
220 int previousValue = -1;
221 for (int row = 0; row < ui.colorMapTable->rowCount(); row++)
222 {
223 auto item = ui.colorMapTable->item(row, 0);
224 if (item->text() != "Other" && row > 0)
225 {
226 auto val = item->data(Qt::EditRole).toInt();
227 if (val == previousValue)
228 {
229 dublicates = true;
230 break;
231 }
232 previousValue = val;
233 }
234 }
235
236 if (dublicates)
237 {
238 if (QMessageBox::question(this,
239 "Dublicate Items",
240 "There are dublicate items in the list. Only the last value of "
241 "dublicates will be set in the map. Do you want to continue?") ==
242 QMessageBox::Yes)
243 {
244 QDialog::done(r);
245 return;
246 }
247 }
248 else
249 QDialog::done(r);
250}

Callers

nothing calls this directly

Calls 3

rowCountMethod · 0.80
textMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected