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

Method on_pushButtonEditMap_clicked

YUViewLib/src/ui/Statisticsstylecontrol.cpp:316–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316void StatisticsStyleControl::on_pushButtonEditMap_clicked()
317{
318 const auto originalColorMap = this->currentItem->colorMapper.colorMap;
319 const auto originalOtherColor = this->currentItem->colorMapper.colorMapOther;
320
321 StatisticsStyleControl_ColorMapEditor colorMapEditor(originalColorMap, originalOtherColor, this);
322
323 connect(&colorMapEditor, &StatisticsStyleControl_ColorMapEditor::mapChanged, [&]() {
324 this->currentItem->colorMapper.colorMap = colorMapEditor.getColorMap();
325 this->currentItem->colorMapper.colorMapOther = colorMapEditor.getOtherColor();
326 this->ui.frameDataColor->setColorMapper(this->currentItem->colorMapper);
327 emit StyleChanged();
328 });
329
330 if (colorMapEditor.exec() == QDialog::Accepted)
331 {
332 auto somethingChanged = originalColorMap != colorMapEditor.getColorMap() ||
333 originalOtherColor != colorMapEditor.getOtherColor();
334 if (somethingChanged)
335 {
336 this->ui.comboBoxCustomMap->setCurrentIndex(-1);
337 this->currentItem->colorMapper.colorMap = colorMapEditor.getColorMap();
338 this->currentItem->colorMapper.colorMapOther = colorMapEditor.getOtherColor();
339 }
340 }
341 else
342 {
343 this->currentItem->colorMapper.colorMap = originalColorMap;
344 this->currentItem->colorMapper.colorMapOther = originalOtherColor;
345 this->ui.frameDataColor->setColorMapper(this->currentItem->colorMapper);
346 emit StyleChanged();
347 }
348}
349
350void StatisticsStyleControl::on_pushButtonSaveMap_clicked()
351{

Callers

nothing calls this directly

Calls 3

getColorMapMethod · 0.80
getOtherColorMethod · 0.80
setColorMapperMethod · 0.80

Tested by

no test coverage detected