forked from qt-creator/qt-creator
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:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user