QmlDesigner: Fix compile fix

Amends 82a010f67a.

Turns out that 04dc959d49e5e3 in Qt 6.4 introduces a source
incompatibility intentionally.

Use 'auto' to cover old and new behavior.

Change-Id: I4cf69393e0c1a483261b3f283b6bce97f664e3ce
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2022-08-22 11:06:32 +02:00
parent c30a695784
commit 70089a8701

View File

@@ -360,13 +360,15 @@ void MaterialBrowserModel::copyMaterialProperties(int idx, const QString &sectio
if (propsSpecObj.contains(section)) { // should always be true
m_copiedMaterialProps.clear();
const QJsonArray propNames = propsSpecObj.value(section).toArray();
for (const QJsonValueConstRef &propName : propNames)
// auto == QJsonValueConstRef after 04dc959d49e5e3 / Qt 6.4, QJsonValueRef before
for (const auto &propName : propNames)
m_copiedMaterialProps.append(mat.property(propName.toString().toLatin1()));
if (section == "Base") { // add QtQuick3D.Material base props as well
QJsonObject propsMatObj = m_propertyGroupsObj.value("Material").toObject();
const QJsonArray propNames = propsMatObj.value("Base").toArray();
for (const QJsonValueConstRef &propName : propNames)
// auto == QJsonValueConstRef after 04dc959d49e5e3 / Qt 6.4, QJsonValueRef before
for (const auto &propName : propNames)
m_copiedMaterialProps.append(mat.property(propName.toString().toLatin1()));
}
}