27 m_EnumerationProperty(property),
29 m_EnumIdToItemIndex(enumIdToItemIndex)
33 ~_EnumPropEditorImpl() { m_EnumerationProperty =
nullptr; }
34 void IndexChanged(
int enumId)
37 m_EnumerationProperty->SetValue(enumId);
43 if (m_EnumerationProperty)
45 m_ComboBox->setCurrentIndex(m_EnumIdToItemIndex[m_EnumerationProperty->GetValueAsId()]);
52 m_EnumerationProperty =
nullptr;
53 m_ComboBox->setEnabled(
false);
58 QComboBox *m_ComboBox;
59 QHash<int, int> m_EnumIdToItemIndex;
64 connect(
this, SIGNAL(currentIndexChanged(
int)),
this, SLOT(
OnIndexChanged(
int)));
87 this->setEnabled(
true);
89 QHash<int, int> enumIdToItemIndex;
93 for (
auto it = strings.begin(); it != strings.end(); ++it, ++index)
95 enumIdToItemIndex.insert(it->second, index);
96 this->addItem(QString::fromStdString(it->first), it->second);
99 propView =
new _EnumPropEditorImpl(property,
this, enumIdToItemIndex);
107 int enumIndex = this->itemData(index, Qt::UserRole).toInt();
virtual void PropertyRemoved()=0
mitk::BaseProperty * m_Property
PropertyEditor(mitk::BaseProperty *)
virtual void PropertyChanged()=0
void BeginModifyProperty()
std::map< std::string, IdType > EnumStringsContainerType