26 proxy->layoutChanged();
31 QPersistentModelIndex sourceIndex = {index};
67 return propertyRelated.contains(item->
modelType());
83 const QPersistentModelIndex& sourceIndex)
86 QPersistentModelIndex proxyIndex =
createProxyIndex(nrows, sourceIndex.column(), item);
122 const QPersistentModelIndex& sourceIndex)
129 if (item->
parent() == groupItem->currentItem()) {
131 parentVisibleRow(*item), sourceIndex.column(), sourceIndex.internalPointer());
142 const QPersistentModelIndex& sourceIndex)
147 if (item->
parent() == groupItem->currentItem()) {
149 parentVisibleRow(*item), sourceIndex.column(), sourceIndex.internalPointer());
158 const QPersistentModelIndex& sourceIndex)
164 QPersistentModelIndex proxyIndex =
169 QPersistentModelIndex sourceParent;
170 if (sourceIndex.parent().isValid())
171 sourceParent = sourceIndex.parent();
#define ASSERT(condition)
Defines class ComponentProxyModel.
Defines class ComponentProxyStrategy.
Defines ComponentUtils namespace.
Defines ModelPath namespace.
Defines namespace SessionItemUtils.
Defines class SessionModel.
Proxy model to adjust SessionModel for component editor (right bottom corner of SampleView and simila...
void onDataChanged(SessionModel *source, ComponentProxyModel *proxy)
bool isNewRootItem(SessionItem *item)
Returns true if item should become new root item.
bool isPropertyRelated(SessionItem *item)
Returns true if item is property related to exclude top level items (ParticleLayout,...
void processSubGroupItem(SessionItem *item, const QPersistentModelIndex &sourceIndex)
Process group property which is inside of other group property.
bool processSourceIndex(const QModelIndex &index)
Mapping of proxy model indices to indices in source model.
bool isSubGroup(SessionItem *item)
Returns true if item is a group property which in turn is inside of another group property.
int parentVisibleRow(const SessionItem &item)
void processRootItem(SessionItem *item, const QPersistentModelIndex &sourceIndex)
Makes SessionItem to become the only one item in a tree.
void processGroupItem(SessionItem *item, const QPersistentModelIndex &sourceIndex)
All properties of current item of group item.
void processDefaultItem(SessionItem *item, const QPersistentModelIndex &sourceIndex)
bool isGroupChildren(SessionItem *item)
Returns true if item is a children/grandchildrent of some group item.
QMap< QPersistentModelIndex, QPersistentModelIndex > m_sourceToProxy
Mapping of proxy model indices to indices of parent in source model.
QPersistentModelIndex m_sourceRootIndex
QMap< QPersistentModelIndex, QPersistentModelIndex > m_proxySourceParent
QModelIndex createProxyIndex(int nrow, int ncol, void *adata)
Method to ask proxy to create an index using friendship of ProxyModelStrategy and ComponentProxyModel...
void buildModelMap(SessionModel *source, ComponentProxyModel *proxy)
SessionItem * parent() const
Returns parent of this item.
QVector< SessionItem * > children() const
Returns vector of all children.
QString modelType() const
Get model type.
QString tagFromItem(const SessionItem *item) const
Returns the tag name of given item when existing.
QModelIndex index() const
Returns model index of this item.
SessionItem * itemForIndex(const QModelIndex &index) const
QStringList propertyRelatedTypes()
Returns list of strings representing modelTypes suitable for editing in component editors.
const SessionItem * ancestor(const SessionItem *item, const QString &requiredModelType)
Returns ancestor of given modelType for given item.