QmlDesigner: Add BakedLightmap item to component library

Also adds relevant property specifics and navigator drop support.

Fixes: QDS-9521
Change-Id: I78539548770ae75fbe0602c2871fb5fea5515ab4
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Miikka Heikkinen
2023-03-24 16:53:23 +02:00
parent feabda3aa7
commit 79f4066dac
6 changed files with 120 additions and 4 deletions

View File

@@ -42,6 +42,8 @@ ChooseFromPropertyListFilter::ChooseFromPropertyListFilter(const NodeMetaInfo &i
// -> Model
// Effect
// -> Item
// BakedLightmap
// -> Model
if (insertInfo.isQtQuick3DTexture()) {
if (parentInfo.isQtQuick3DDefaultMaterial() || parentInfo.isQtQuick3DPrincipledMaterial()
@@ -101,6 +103,9 @@ ChooseFromPropertyListFilter::ChooseFromPropertyListFilter(const NodeMetaInfo &i
} else if (insertInfo.isEffectMaker()) {
if (parentInfo.isQtQuickItem())
propertyList.append("effect");
} else if (insertInfo.isQtQuick3DBakedLightmap()) {
if (parentInfo.isQtQuick3DModel())
propertyList.append("bakedLightmap");
}
}

View File

@@ -118,6 +118,7 @@ public:
bool isQtMultimediaSoundEffect() const;
bool isQtObject() const;
bool isQtQuick3D() const;
bool isQtQuick3DBakedLightmap() const;
bool isQtQuick3DBuffer() const;
bool isQtQuick3DCamera() const;
bool isQtQuick3DCommand() const;

View File

@@ -2245,7 +2245,17 @@ bool NodeMetaInfo::isQtQuick3DCamera() const
using namespace Storage::Info;
return isBasedOnCommonType<QtQuick3D, Camera>(m_projectStorage, m_typeId);
} else {
return isValid() && isSubclassOf("QQuick3D.Camera");
return isValid() && isSubclassOf("QtQuick3D.Camera");
}
}
bool NodeMetaInfo::isQtQuick3DBakedLightmap() const
{
if constexpr (useProjectStorage()) {
using namespace Storage::Info;
return isBasedOnCommonType<QtQuick3D, BakedLightmap>(m_projectStorage, m_typeId);
} else {
return isValid() && isSubclassOf("QtQuick3D.BakedLightmap");
}
}
@@ -2255,7 +2265,7 @@ bool NodeMetaInfo::isQtQuick3DBuffer() const
using namespace Storage::Info;
return isBasedOnCommonType<QtQuick3D, Buffer>(m_projectStorage, m_typeId);
} else {
return isValid() && isSubclassOf("QQuick3D.Buffer");
return isValid() && isSubclassOf("QtQuick3D.Buffer");
}
}
@@ -2265,7 +2275,7 @@ bool NodeMetaInfo::isQtQuick3DInstanceListEntry() const
using namespace Storage::Info;
return isBasedOnCommonType<QtQuick3D, InstanceListEntry>(m_projectStorage, m_typeId);
} else {
return isValid() && isSubclassOf("QQuick3D.InstanceListEntry");
return isValid() && isSubclassOf("QtQuick3D.InstanceListEntry");
}
}
@@ -2275,7 +2285,7 @@ bool NodeMetaInfo::isQtQuick3DInstanceList() const
using namespace Storage::Info;
return isBasedOnCommonType<QtQuick3D, InstanceList>(m_projectStorage, m_typeId);
} else {
return isValid() && isSubclassOf("QQuick3D.InstanceList");
return isValid() && isSubclassOf("QtQuick3D.InstanceList");
}
}

View File

@@ -791,4 +791,26 @@ MetaInfo {
toolTip: qsTr("A sound object in 3D space.")
}
}
Type {
name: "QtQuick3D.BakedLightmap"
icon: ":/ItemLibrary/images/item-default-icon.png"
Hints {
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
canBeDroppedInView3D: false
}
ItemLibraryEntry {
name: "Baked Lightmap"
category: "Components"
libraryIcon: ":/ItemLibrary/images/item-default-icon.png"
version: "6.5"
requiredImport: "QtQuick3D"
toolTip: qsTr("An object to specify details about baked lightmap of a model.")
Property { name: "loadPrefix"; type: "string"; value: "lightmaps"; }
}
}
}