QML assert_imports created by QT Design Studio is not installed in QT Creator
-
I created a regular QML project in QT Creator, but with an option that says the project can be used/opened in QT Design Studio.
That created a default project with "asset_imports" folder that contained "asset_imports.txt".
I added an asset in QT Design Studio through assets section.
That created a folder called "Quick3DAssets", and a folder in that called "Bitcoin", which is the asset i added. It's an .obj file that represents a 3D Model.
The folder Bitcoin has files like "Bitcoin.qml" and qmldir also folder like meshes and source scene.
Everything works perfectly fine in QT Design Studio, but when trying to run an application in QT Creator I get: qrc:/qt/qml/content/Screen01.ui.qml:13:1: module "Quick3DAssets.Bitcoin" is not installed
on line: import Quick3DAssets.Bitcoin in Screen01.ui.qml.
Also I was adding a bunch of .png files, that also cannot be found, but that doesn't result in application not running. It doesn't see an entire asset_imports, not just Quick3DAssets.
I've read that it might be related to engine.addImportPath in .main.cpp, I tried adding some combinations of different paths, but that doesn't help.
I created a minimal reproducible example by creating a completely new project and without doing any change to the code I just added the .obj files in QT Design Studio and dragged it onto the scene, so that .qml file would change. I still get that same error.
Literally a new project, looks like some sort of problem that needs fixing in CMakeLists or in main.cpp.
There are a lot of files in the project, so if You want me to include some code just ask, but I just created a new project and all of the code is QT's generated.
I'm using QT 6.7.0, Qt design studio 4.5.0 and QT Creator 13.0.1, with cmake, not qmake
-
I solved it in other way. I create a QML project by qt design studio rather than qt creator frist. Then, I added some 3D assets in the project by qds. After that, I used qt creator opened this project and those 3D assets were represented successfully. By the way, if you want to create a QML project by qt design studio, you need click File -> Export Project -> Enable Automate Generation after build a qds project, and then you will find a qml project organized by cmake file.