QmlDesigner: Properly set metatype hints on Model import

When 3D import results in a .qml file with Model as root item,
metatype hints are now set to correctly treat the item as 3D node.

Fixes: QDS-6206
Change-Id: Iaad0d37bcd93eefca87b6c09f6e4f398064fba90
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2022-02-14 13:53:01 +02:00
parent f9cceb6267
commit c2db646c6e

View File

@@ -389,7 +389,7 @@ void ItemLibraryAssetImporter::postParseQuick3DAsset(const ParseData &pd)
if (braceIdx != -1) { if (braceIdx != -1) {
int nlIdx = content.lastIndexOf('\n', braceIdx); int nlIdx = content.lastIndexOf('\n', braceIdx);
QByteArray rootItem = content.mid(nlIdx, braceIdx - nlIdx).trimmed(); QByteArray rootItem = content.mid(nlIdx, braceIdx - nlIdx).trimmed();
if (rootItem == "Node") { // a 3D object if (rootItem == "Node" || rootItem == "Model") { // a 3D object
// create hints file with proper hints // create hints file with proper hints
QFile file(outDir.path() + '/' + fi.baseName() + ".hints"); QFile file(outDir.path() + '/' + fi.baseName() + ".hints");
file.open(QIODevice::WriteOnly | QIODevice::Text); file.open(QIODevice::WriteOnly | QIODevice::Text);