33 throw Error(
"GroupItem::setGroup() -> Error. Attempt to set group twice.");
35 m_controller = std::make_unique<GroupItemController>(
this, groupInfo);
73 if (!
value().canConvert<ComboProperty>())
74 throw Error(
"GroupItem::onValueChange() -> Error. Wrong property type");
77 if (property.currentIndex() !=
m_controller->currentIndex()) {
Defines class ComboProperty.
Custom property to define list of string values with multiple selections. Intended for QVariant.
Defines info for GroupProperty, i.e. collection of model types, their labels and the name of default ...
SessionItem * setCurrentType(const QString &modelType)
void setGroupInfo(const GroupInfo &groupInfo)
static bool isItemsTagName(const QString &name)
static constexpr auto T_ITEMS
SessionItem * getItemOfType(const QString &type) const
QVector< SessionItem * > groupItems() const
SessionItem * currentItem() const
QString currentType() const
std::unique_ptr< GroupItemController > m_controller
void setOnValueChange(std::function< void(void)> f, const void *caller=nullptr)
Base class for a GUI data item.
bool registerTag(const QString &name, int min=0, int max=-1, QStringList modelTypes={})
Add new tag to this item with given name, min, max and types. max = -1 -> unlimited,...
QVector< SessionItem * > getItems(const QString &tag="") const
Returns vector of all items of given tag.
QVariant value() const
Get value.
bool setValue(QVariant value)
Set value, ensure that variant types match.
ModelMapper * mapper()
Returns the current model mapper of this item. Creates new one if necessary.
void setDefaultTag(const QString &tag)
Set default tag.
void emitDataChanged(int role=Qt::DisplayRole)
Notify model about data changes.
QString modelType() const
Get model type.
QString const & name(EShape k)