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:
Thomas Hartmann
2022-09-09 16:33:23 +02:00
parent 26e5b3787c
commit 39f44cf57c
8 changed files with 218 additions and 49 deletions

View File

@@ -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);
}
}