Skip to content
Snippets Groups Projects
Commit 38524db2 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

PropertyRepeater now can work with director item's properties.

parent 9f65316f
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ void PropertyRepeater::addItem(IntensityDataItem* intensityItem) ...@@ -37,7 +37,7 @@ void PropertyRepeater::addItem(IntensityDataItem* intensityItem)
}, this); }, this);
intensityItem->mapper()->setOnPropertyChange( intensityItem->mapper()->setOnPropertyChange(
[this](const QString& name) { onPropertyChanged(name); }, this); [this](SessionItem* item, const QString& name) { onPropertyChanged(item, name); }, this);
intensityItem->mapper()->setOnChildPropertyChange( intensityItem->mapper()->setOnChildPropertyChange(
[this](SessionItem* item, const QString& name) { [this](SessionItem* item, const QString& name) {
...@@ -56,18 +56,24 @@ void PropertyRepeater::clear() ...@@ -56,18 +56,24 @@ void PropertyRepeater::clear()
m_dataItems.clear(); m_dataItems.clear();
} }
void PropertyRepeater::onPropertyChanged(const QString& propertyName) void PropertyRepeater::onPropertyChanged(SessionItem* item, const QString& propertyName)
{ {
if (m_block_repeater) if (m_block_repeater)
return; return;
m_block_repeater = true; m_block_repeater = true;
Q_UNUSED(propertyName); QVariant value = item->getItemValue(propertyName);
qDebug() << item->modelType() << propertyName << value;
for (auto target : targetItems(item))
target->setItemValue(propertyName, value);
m_block_repeater = false; m_block_repeater = false;
} }
void PropertyRepeater::setOnChildPropertyChange(SessionItem* item, const QString& propertyName) void PropertyRepeater::setOnChildPropertyChange(SessionItem* item, const QString& propertyName)
{ {
if (m_block_repeater) if (m_block_repeater)
......
...@@ -37,7 +37,7 @@ public: ...@@ -37,7 +37,7 @@ public:
void clear(); void clear();
private: private:
void onPropertyChanged(const QString& propertyName); void onPropertyChanged(SessionItem* item, const QString& propertyName);
void setOnChildPropertyChange(SessionItem* item, const QString& propertyName); void setOnChildPropertyChange(SessionItem* item, const QString& propertyName);
QVector<SessionItem*> targetItems(SessionItem* sourceItem); QVector<SessionItem*> targetItems(SessionItem* sourceItem);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment