diff --git a/GUI/View/Device/BackgroundForm.cpp b/GUI/View/Device/BackgroundForm.cpp index 779729ffb131f63002be33450ff130240de44aa8..354b176b450dbc9d5c0a76c78a5ccbf2a7694782 100644 --- a/GUI/View/Device/BackgroundForm.cpp +++ b/GUI/View/Device/BackgroundForm.cpp @@ -28,7 +28,7 @@ BackgroundForm::BackgroundForm(QWidget* parent, InstrumentItem* instrument) m_form_layout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); body()->setLayout(m_form_layout); - auto* backgroundTypeCombo = GUI::Util::createComboBoxFromProperty( + auto* backgroundTypeCombo = GUI::Util::createComboBoxFromPolyitem( instrument->backgroundSelection(), [this](int) { createBackgroundWidgets(); diff --git a/GUI/View/Device/DetectorEditor.cpp b/GUI/View/Device/DetectorEditor.cpp index cc864b222de9bc4a49f76dd4a6369902d878157d..f901f42495ef5a24cbfd17004ca5c4da32545a58 100644 --- a/GUI/View/Device/DetectorEditor.cpp +++ b/GUI/View/Device/DetectorEditor.cpp @@ -73,7 +73,7 @@ DetectorEditor::DetectorEditor(QWidget* parent, Scatter2DInstrumentItem* instrIt } }; - auto* typeCombo = GUI::Util::createComboBoxFromProperty( + auto* typeCombo = GUI::Util::createComboBoxFromPolyitem( detectorItem->resolutionFunctionSelection(), [this, updateResolutionForm](int) { updateResolutionForm(); diff --git a/GUI/View/Device/DistributionSelector.cpp b/GUI/View/Device/DistributionSelector.cpp index 29f708691d5b53c971c058c68ebe09baba10978e..2545fee5ce42bf68ab419003f7909e9525bbd096 100644 --- a/GUI/View/Device/DistributionSelector.cpp +++ b/GUI/View/Device/DistributionSelector.cpp @@ -33,7 +33,7 @@ DistributionSelector::DistributionSelector(std::optional<MeanConfig> mean_config m_form_layout = new QFormLayout(this); m_form_layout->setContentsMargins(0, 0, 0, 0); - m_distribution_combo = GUI::Util::createComboBoxFromProperty( + m_distribution_combo = GUI::Util::createComboBoxFromPolyitem( item->distributionSelection(), [this](int) { createDistributionWidgets(); diff --git a/GUI/View/Device/FootprintForm.cpp b/GUI/View/Device/FootprintForm.cpp index 64cb5cbe6864d12d1a87a263c2ccba5165d90b40..a88e656e94228ded47509bace5c30ef477d5c19d 100644 --- a/GUI/View/Device/FootprintForm.cpp +++ b/GUI/View/Device/FootprintForm.cpp @@ -28,7 +28,7 @@ FootprintForm::FootprintForm(QWidget* parent, SourceItem* item) { m_form_layout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); ASSERT(item->footprintSelection().certainItem()); - auto* typeCombo = GUI::Util::createComboBoxFromProperty( + auto* typeCombo = GUI::Util::createComboBoxFromPolyitem( item->footprintSelection(), [this](int) { updateFootprintWidgets(); diff --git a/GUI/View/Numeric/ComboUtil.h b/GUI/View/Numeric/ComboUtil.h index 1dabafa414ee1c27994543495923ae6ac11b7300..6a2fd46ec8e0b8d1e432de9cc641dec4d14f829b 100644 --- a/GUI/View/Numeric/ComboUtil.h +++ b/GUI/View/Numeric/ComboUtil.h @@ -47,7 +47,7 @@ QComboBox* createComboBox(std::function<ComboProperty()> comboFunction, //! Changes in the combobox will be notified to the PolyItem already. The additional (and //! optional) slot can be used to be notified about an already executed change. template <typename T> QComboBox* -createComboBoxFromProperty(PolyItem<T>& d, std::function<void(int)> slot, bool inScrollArea) +createComboBoxFromPolyitem(PolyItem<T>& d, std::function<void(int)> slot, bool inScrollArea) { auto* combo = new QComboBox; combo->addItems(d.options());