Where to find?
-
Such imports (especially for a big project started a long time ago (before Qt 5.15 or Qt 6)) can mean 2 things:
- somewhere there is a file (one or more) called
qmldir
which contains the definitions of all (or some) of those imports - somewhere in c++ (often in main.cpp, but can be elsewhere) there will be calls to register QML types https://doc.qt.io/archives/qt-5.12/qqmlengine.html#qmlRegisterType
- somewhere there is a file (one or more) called
-
@sierdzio apologies for the slight diversion, but what would be the modern (5.15/6) approach to this sort of import? I need to start learning about this stuff as I am going to be in the position of bringing a 5.9 project up to date soon - initially to 5.15 but ultimately to 6.x in the not too distant future.
-
@Bob64 said in Where to find?:
@sierdzio apologies for the slight diversion, but what would be the modern (5.15/6) approach to this sort of import? I need to start learning about this stuff as I am going to be in the position of bringing a 5.9 project up to date soon - initially to 5.15 but ultimately to 6.x in the not too distant future.
I'm not an expert on that, still stuck on Qt 5.12 on my main project now :/
But the new approach is more centered about new macros that automate this registration: https://doc.qt.io/qt-6/qtqml-cppintegration-definetypes.html#registering-an-instantiable-object-typeSee:
QML_ELEMENT
,QML_IMPORT_NAME
etc.