forked from qt-creator/qt-creator
QmlDesigner: Fix expressions in DynamicPropertyRow and states
* States are now taken into account. * If name is empty in expressionChanged(), then this is just a notifier for the QML frontend and has to be ignored. * When exposing the expression to QML we also have to take into account states. * Implementing resetting dynamic properties. We have to hardcode the default values for the base state * I also implemented the callbacks in the views for PropertyChanges. Change-Id: I08247a3c1783a52853db7bf0f7f249520f7edc1c Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -111,6 +111,8 @@ void ConnectionView::propertiesRemoved(const QList<AbstractProperty> &propertyLi
|
||||
for (const AbstractProperty &property : propertyList) {
|
||||
if (property.isDefaultProperty())
|
||||
connectionModel()->resetModel();
|
||||
|
||||
dynamicPropertiesModel()->dispatchPropertyChanges(property);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,8 +140,9 @@ void ConnectionView::variantPropertiesChanged(const QList<VariantProperty> &prop
|
||||
backendModel()->resetModel();
|
||||
|
||||
connectionModel()->variantPropertyChanged(variantProperty);
|
||||
}
|
||||
|
||||
dynamicPropertiesModel()->dispatchPropertyChanges(variantProperty);
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectionView::bindingPropertiesChanged(const QList<BindingProperty> &propertyList,
|
||||
@@ -153,6 +156,8 @@ void ConnectionView::bindingPropertiesChanged(const QList<BindingProperty> &prop
|
||||
backendModel()->resetModel();
|
||||
|
||||
connectionModel()->bindingPropertyChanged(bindingProperty);
|
||||
|
||||
dynamicPropertiesModel()->dispatchPropertyChanges(bindingProperty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user