forked from qt-creator/qt-creator
QmlDesigner: Detect asset drag'n'drop support based on property type
Handle property support for asset drag based on property type rather than name in order to support properties with any name (like lightProbe). Change-Id: I20fd422119db96aebd505b47888c97f0d94bf7f9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -767,11 +767,16 @@ void MaterialEditorView::customNotification(const AbstractView *view, const QStr
|
||||
|
||||
void QmlDesigner::MaterialEditorView::highlightSupportedProperties(bool highlight)
|
||||
{
|
||||
if (!m_selectedMaterial.isValid())
|
||||
return;
|
||||
|
||||
DesignerPropertyMap &propMap = m_qmlBackEnd->backendValuesPropertyMap();
|
||||
const QStringList propNames = propMap.keys();
|
||||
NodeMetaInfo metaInfo = m_selectedMaterial.metaInfo();
|
||||
QTC_ASSERT(metaInfo.isValid(), return);
|
||||
|
||||
for (const QString &propName : propNames) {
|
||||
if (propName.endsWith("Map")) {
|
||||
if (metaInfo.propertyTypeName(propName.toLatin1()) == "QtQuick3D.Texture") {
|
||||
QObject *propEditorValObj = propMap.value(propName).value<QObject *>();
|
||||
PropertyEditorValue *propEditorVal = qobject_cast<PropertyEditorValue *>(propEditorValObj);
|
||||
propEditorVal->setHasActiveDrag(highlight);
|
||||
|
||||
Reference in New Issue
Block a user