| 314 | } |
| 315 | |
| 316 | void 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 | |
| 350 | void StatisticsStyleControl::on_pushButtonSaveMap_clicked() |
| 351 | { |
nothing calls this directly
no test coverage detected