forked from qt-creator/qt-creator
QmlDesigner: Dynamic properties in Bindind Editor
Change-Id: Iaf0b78546905cacbc7e1a5524aaf918f253e0131 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -35,6 +35,9 @@
|
||||
#include <nodelistproperty.h>
|
||||
#include <propertyeditorvalue.h>
|
||||
|
||||
#include <bindingproperty.h>
|
||||
#include <variantproperty.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
static BindingEditor *s_lastBindingEditor = nullptr;
|
||||
@@ -172,6 +175,26 @@ void BindingEditor::prepareBindings()
|
||||
binding.properties.append(QString::fromUtf8(propertyName));
|
||||
}
|
||||
|
||||
//dynamic properties:
|
||||
for (const BindingProperty &bindingProperty : objnode.bindingProperties()) {
|
||||
if (bindingProperty.isValid()) {
|
||||
if (bindingProperty.isDynamic()) {
|
||||
if (bindingProperty.dynamicTypeName() == m_backendValueTypeName) {
|
||||
binding.properties.append(QString::fromUtf8(bindingProperty.name()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const VariantProperty &variantProperty : objnode.variantProperties()) {
|
||||
if (variantProperty.isValid()) {
|
||||
if (variantProperty.isDynamic()) {
|
||||
if (variantProperty.dynamicTypeName() == m_backendValueTypeName) {
|
||||
binding.properties.append(QString::fromUtf8(variantProperty.name()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!binding.properties.isEmpty() && objnode.hasId()) {
|
||||
binding.item = objnode.displayName();
|
||||
bindings.append(binding);
|
||||
|
||||
Reference in New Issue
Block a user