QmlDesigner: no extra method necessary

Change-Id: I1f088246936140112823e319bbf9ccfd58b0ec34
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tim Jenssen
2018-09-18 14:24:41 +02:00
parent 80c4a9b785
commit cdfb4c6cb6

View File

@@ -130,16 +130,6 @@ void PropertyEditorQmlBackend::setupPropertyEditorValue(const PropertyName &name
} }
static PropertyNameList layoutAttachedPropertiesNames()
{
PropertyNameList propertyNames;
propertyNames << "alignment" << "column" << "columnSpan" << "fillHeight" << "fillWidth"
<< "maximumHeight" << "maximumWidth" << "minimumHeight" << "minimumWidth"
<< "preferredHeight" << "preferredWidth" << "row"<< "rowSpan";
return propertyNames;
}
QVariant properDefaultLayoutAttachedProperties(const QmlObjectNode &qmlObjectNode, const PropertyName &propertyName) QVariant properDefaultLayoutAttachedProperties(const QmlObjectNode &qmlObjectNode, const PropertyName &propertyName)
{ {
QVariant value = qmlObjectNode.modelValue(propertyName); QVariant value = qmlObjectNode.modelValue(propertyName);
@@ -169,7 +159,9 @@ void PropertyEditorQmlBackend::setupLayoutAttachedProperties(const QmlObjectNode
{ {
if (QmlItemNode(qmlObjectNode).isInLayout()) { if (QmlItemNode(qmlObjectNode).isInLayout()) {
static const PropertyNameList propertyNames = layoutAttachedPropertiesNames(); static const PropertyNameList propertyNames =
{"alignment", "column", "columnSpan", "fillHeight", "fillWidth", "maximumHeight", "maximumWidth",
"minimumHeight", "minimumWidth", "preferredHeight", "preferredWidth", "row", "rowSpan"};
foreach (const PropertyName &propertyName, propertyNames) { foreach (const PropertyName &propertyName, propertyNames) {
createPropertyEditorValue(qmlObjectNode, "Layout." + propertyName, properDefaultLayoutAttachedProperties(qmlObjectNode, propertyName), propertyEditor); createPropertyEditorValue(qmlObjectNode, "Layout." + propertyName, properDefaultLayoutAttachedProperties(qmlObjectNode, propertyName), propertyEditor);