33 QStringList parents_with_abundance()
35 return QStringList() <<
"ParticleCoreShell"
36 <<
"ParticleComposition"
37 <<
"ParticleDistribution"
58 if (child->isVisible())
70 return item.
isEnabled() ? QVariant() : QColor(Qt::gray);
75 QString result = item.
toolTip();
76 if (result.isEmpty()) {
78 if (ncol == 1 && item.
value().canConvert<QString>())
79 result = item.
value().toString();
82 return QVariant(result);
95 if (item.
value().type() == QVariant::Bool)
96 return item.
value().toBool() ? Qt::Checked : Qt::Unchecked;
102 return groupInfoCatalog().containsGroup(group_type);
107 return groupInfoCatalog().groupInfo(group_type);
112 int result =
static_cast<int>(variant.type());
113 if (result == QVariant::UserType)
114 result = variant.userType();
123 if (oldValue.isValid())
139 if (var1.type() == QVariant::UserType)
158 static QStringList special_parent = parents_with_abundance();
159 return item ? special_parent.contains(item->
modelType()) :
false;
Defines class ExternalProperty.
Defines class GUIHelpers functions.
Defines class GroupInfoCatalog.
Defines class MaterialItem.
Defines class SessionGraphicsItem.
Defines namespace SessionItemUtils.
Defines class VectorItem.
The ExternalProperty class defines custom QVariant property to carry the text, color and an identifie...
Catalog to hold info for GroupProperty creation.
Defines info for GroupProperty, i.e.
static const QString P_XPOS
static const QString P_YPOS
QString displayName() const
Get display name of item, append index if ambigue.
QVariant value() const
Get value.
int rowOfChild(SessionItem *child) const
Returns row index of given child.
SessionItem * parent() const
Returns parent of this item.
QVector< SessionItem * > children() const
Returns vector of all children.
QString modelType() const
Get model type.
QVariant DecorationRole(const SessionItem &item)
Returns tooltip for given item.
bool IsTheSame(const QVariant &var1, const QVariant &var2)
Returns true if given variants have same type and value.
int VariantType(const QVariant &variant)
Returns type of variant (additionally checks for user type).
QVariant CheckStateRole(const SessionItem &item)
Returns check state for given item.
QVariant ToolTipRole(const SessionItem &item, int ncol=0)
Returns tooltip for given item.
QVariant ForegroundRole(const SessionItem &item)
Returns text color for given item.
bool CompatibleVariantTypes(const QVariant &oldValue, const QVariant &newValue)
Returns true if variants has compatible types.
bool IsPositionRelated(const SessionItem &item)
Returns true if current item is related to the position on sample editor canvas.
bool IsValidGroup(const QString &group_type)
Returns true if there is registered group.
int ParentVisibleRow(const SessionItem &item)
Returns the row of the given item within its parent not accounting for all hidden items above.
int ParentRow(const SessionItem &item)
Returns the index of the given item within its parent. Returns -1 when no parent is set.
GroupInfo GetGroupInfo(const QString &group_type)
Returns GroupInfo for group property construction.
bool HasOwnAbundance(const SessionItem *item)