summaryrefslogtreecommitdiff
path: root/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp')
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp36
1 files changed, 33 insertions, 3 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
index 3606f626a5..09af5cb0a0 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
@@ -171,6 +171,17 @@ QVariant properDefaultLayoutAttachedProperties(const QmlObjectNode &qmlObjectNod
return QVariant();
}
+
+QVariant properDefaultInsightAttachedProperties(const QmlObjectNode &qmlObjectNode,
+ const PropertyName &propertyName)
+{
+ const QVariant value = qmlObjectNode.modelValue("InsightCategory." + propertyName);
+
+ if (value.isValid())
+ return value;
+
+ return QString();
+}
} // namespace
void PropertyEditorQmlBackend::setupLayoutAttachedProperties(const QmlObjectNode &qmlObjectNode, PropertyEditorView *propertyEditor)
@@ -188,6 +199,16 @@ void PropertyEditorQmlBackend::setupLayoutAttachedProperties(const QmlObjectNode
}
}
+void PropertyEditorQmlBackend::setupInsightAttachedProperties(const QmlObjectNode &qmlObjectNode,
+ PropertyEditorView *propertyEditor)
+{
+ const PropertyName propertyName = "category";
+ createPropertyEditorValue(qmlObjectNode,
+ "InsightCategory." + propertyName,
+ properDefaultInsightAttachedProperties(qmlObjectNode, propertyName),
+ propertyEditor);
+}
+
void PropertyEditorQmlBackend::setupAuxiliaryProperties(const QmlObjectNode &qmlObjectNode,
PropertyEditorView *propertyEditor)
{
@@ -262,9 +283,9 @@ void PropertyEditorQmlBackend::setupAuxiliaryProperties(const QmlObjectNode &qml
}
void PropertyEditorQmlBackend::createPropertyEditorValue(const QmlObjectNode &qmlObjectNode,
- const PropertyName &name,
- const QVariant &value,
- PropertyEditorView *propertyEditor)
+ const PropertyName &name,
+ const QVariant &value,
+ PropertyEditorView *propertyEditor)
{
PropertyName propertyName(name);
propertyName.replace('.', '_');
@@ -397,6 +418,7 @@ void PropertyEditorQmlBackend::setup(const QmlObjectNode &qmlObjectNode, const Q
propertyEditor);
}
setupLayoutAttachedProperties(qmlObjectNode, propertyEditor);
+ setupInsightAttachedProperties(qmlObjectNode, propertyEditor);
setupAuxiliaryProperties(qmlObjectNode, propertyEditor);
// model node
@@ -888,6 +910,14 @@ void PropertyEditorQmlBackend::setValueforLayoutAttachedProperties(const QmlObje
}
}
+void PropertyEditorQmlBackend::setValueforInsightAttachedProperties(const QmlObjectNode &qmlObjectNode,
+ const PropertyName &name)
+{
+ PropertyName propertyName = name;
+ propertyName.replace("InsightCategory.", "");
+ setValue(qmlObjectNode, name, properDefaultInsightAttachedProperties(qmlObjectNode, propertyName));
+}
+
void PropertyEditorQmlBackend::setValueforAuxiliaryProperties(const QmlObjectNode &qmlObjectNode,
AuxiliaryDataKeyView key)
{