28 , m_default_selected_index(0)
36 return data<ComboProperty>().currentIndex();
63 throw std::runtime_error(
"GroupItem::setCurrentType() -> Model type '" +
model_type
64 +
"' doesn't belong to the group");
71 auto combo = data<ComboProperty>();
72 combo.setCurrentIndex(index);
Custom property to define list of string values with multiple selections.
void setValues(const std::vector< std::string > &values)
Sets new list of values. Current value will be preserved, if exists in a new list.
void setCurrentIndex(int index)
Group item holds collection of predefined items.
void init_group()
Inits group item by creating all registered items and constructing combo property for switching betwe...
const SessionItem * currentItem() const
Returns currently selected item.
void setCurrentType(const std::string &model_type)
Sets item corresponding to given model type.
static const std::string T_GROUP_ITEMS
GroupItem(model_type modelType=Constants::GroupItemType)
std::string currentType() const
bool is_valid_index() const
std::unique_ptr< ItemCatalogue > m_catalogue
void setCurrentIndex(int index)
int m_default_selected_index
Catalogue for item constructions.
The main object representing an editable/displayable/serializable entity.
SessionItem * getItem(const std::string &tag, int row=0) const
Returns item at given row of given tag.
void registerTag(const TagInfo &tagInfo, bool set_as_default=false)
Registers tag to hold items under given name.
bool setData(const T &value, int role=ItemDataRole::DATA, bool direct=false)
Sets data for a given role.
bool insertItem(SessionItem *item, const TagRow &tagrow)
Insert item into given tag under the given row.
static TagInfo universalTag(std::string name, std::vector< std::string > modelTypes={})
Constructs universal tag intended for unlimited amount of various items.
static TagRow append(const std::string &tag_name={})
Returns TagRow corresponding to the append to tag_name.
const int DATA
main data role
int IndexOfItem(It begin, It end, const T &item)
Returns index corresponding to the first occurance of the item in the container.
materialitems.h Collection of materials to populate MaterialModel.