0
votes

I am getting started with qt and especially qt quick now and wanted to do the example from here: https://doc.qt.io/qt-5/qtquick3d-simple-example.html

However already the line import QtQuick3D 1.15 has been giving me headaches. The error that is printed says QML Module not found (QtQuick3D). If I am trying to import other things, I get the corresponding errors.

The error message also tells me "for qmake projects use the QML_IMPORT_PATH variable to add import paths" however I don't know what path and how I should set this?

Another solution I have seen is the one suggested here: https://stackoverflow.com/a/64952178/13533641. Again I am unsure which path to add here. I tried "/usr/lib/qt5/bin" and "/home/Qt/5.15.2/gcc_64/bin". After setting the value I restarted Qt Creator but the error remained.

The project I have been using is an empty QT Quick application which you get if you create a new project. I just added that one import line.

I have used the Mainainance Tools to check the plugins and I installed something that was named 3D. I am unsure if this is the "normal" qtwidget thing or the one I am trying to use in the code. (Or maybe there is no difference anyway, who knows)

I use qt version 5.15 right now but I also tried installing the 5.9 and 6. Everywhere I have the same problem. My machine runs ubuntu 20.04 and I installed qt using the official download for linux. If I am correct, it got installed in the directory /home/Qt.

Does anybody know how to solve this?

1

1 Answers

0
votes

After trying different paths and versions of Qt, I found this this instruction here

However I only needed to follow until the picture of the mainaintance tool and not the building afterwards. Before I had already added the additional library for Qt3d. This enough wasn't enough apparently, after adding the Qt-shader tools it and conan it worked however.

I did this after yet another fresh installation of Qt (this time version 6) and it worked now. Regarding the suggested change for the qml emulation layer: the path that is now set is /home/Qt/5.15.2/gcc_64/bin. Hope this helps someone in the future!