MCPcopy Create free account
hub / github.com/CloudCompare/CloudCompare / init

Method init

libs/CCPluginAPI/src/ccColorScaleSelector.cpp:54–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void ccColorScaleSelector::init()
55{
56 //fill combox box
57 if (m_comboBox)
58 {
59 m_comboBox->disconnect(this);
60
61 m_comboBox->clear();
62 //add all available color scales
63 assert(m_manager);
64
65 //sort the scales by their name
66 //DGM: See doc about qSort --> "An alternative to using qSort() is to put the items to sort in a QMap, using the sort key as the QMap key."
67 QMap<QString, QString> scales;
68 for (ccColorScalesManager::ScalesMap::const_iterator it = m_manager->map().constBegin(); it != m_manager->map().constEnd(); ++it)
69 {
70 scales.insert((*it)->getName(), (*it)->getUuid());
71 }
72
73 for (QMap<QString, QString>::const_iterator scale = scales.constBegin(); scale != scales.constEnd(); ++scale)
74 {
75 m_comboBox->addItem(scale.key(), scale.value());
76 }
77
78 connect(m_comboBox, qOverload<int>(&QComboBox::activated), this, &ccColorScaleSelector::colorScaleSelected);
79 }
80 //advanced tool button
81 if (m_button)
82 {
83 m_button->disconnect(this);
84 connect(m_button, &QAbstractButton::clicked, this, &ccColorScaleSelector::colorScaleEditorSummoned);
85 }
86}
87
88ccColorScale::Shared ccColorScaleSelector::getSelectedScale() const
89{

Callers

nothing calls this directly

Calls 7

constBeginMethod · 0.80
constEndMethod · 0.80
addItemMethod · 0.80
clearMethod · 0.45
insertMethod · 0.45
getNameMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected