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

Method on_blockDataTab_currentChanged

YUViewLib/src/ui/Statisticsstylecontrol.cpp:166–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166void StatisticsStyleControl::on_blockDataTab_currentChanged(int index)
167{
168 auto &colorMapper = this->currentItem->colorMapper;
169 if (index == 0)
170 {
171 colorMapper.mappingType = MappingType::Predefined;
172 this->ui.comboBoxPredefined->setCurrentIndex(
173 int(stats::color::PredefinedTypeMapper.indexOf(colorMapper.predefinedType)));
174 this->ui.spinBoxPredefinedRangeMin->setValue(colorMapper.valueRange.min);
175 this->ui.spinBoxPredefinedRangeMax->setValue(colorMapper.valueRange.max);
176 }
177 else if (index == 1)
178 {
179 colorMapper.mappingType = MappingType::Gradient;
180 this->ui.frameGradientStartColor->setPlainColor(
181 functionsGui::toQColor(colorMapper.gradientColorStart));
182 this->ui.frameGradientEndColor->setPlainColor(
183 functionsGui::toQColor(colorMapper.gradientColorEnd));
184 this->ui.spinBoxGradientRangeMin->setValue(colorMapper.valueRange.min);
185 this->ui.spinBoxGradientRangeMax->setValue(colorMapper.valueRange.max);
186 }
187 else if (index == 2)
188 {
189 if (colorMapper.mappingType != MappingType::Map)
190 {
191 colorMapper.colorMap = convertNonMapTypeToColorMap(colorMapper);
192 }
193 colorMapper.mappingType = MappingType::Map;
194 if (auto customMapEntry = this->customColorMapStorage.indexOfColorMap(
195 colorMapper.colorMap, colorMapper.colorMapOther))
196 this->ui.comboBoxCustomMap->setCurrentIndex(int(*customMapEntry));
197 else
198 this->ui.comboBoxCustomMap->setCurrentIndex(-1);
199 }
200 this->ui.frameDataColor->setColorMapper(colorMapper);
201 emit StyleChanged();
202}
203
204void StatisticsStyleControl::on_comboBoxPredefined_currentIndexChanged(int index)
205{

Callers 1

setStatsItemMethod · 0.95

Calls 5

indexOfMethod · 0.80
setPlainColorMethod · 0.80
indexOfColorMapMethod · 0.80
setColorMapperMethod · 0.80

Tested by

no test coverage detected