[Interest] Qt 6.5.2 and qmllint questions/issues

Ulf Hermann ulf.hermann at qt.io
Wed Aug 30 14:59:37 CEST 2023


> Rule
> of thumb is "one module: one directory, one CMakeLists.txt + uri must
> follow source directory structure from project base". Im my experience
> any derivation from that rule causes pain and suffering ;-) Or maybe I
> still don't fully understand the IMPORTS, OPTIONAL_IMPORTS.
> DEFAULT_IMPORTS, DEPENDENCIES. IMPORT_PATH. OUTPUT_TARGETS and
> OUTPUT_DIRECTORY options of qt_add_qml_module.

I can only agree here.

The pain and suffering is caused by having to tell the tooling and the 
QML engine where your QML code and all the generated files are at 
compile/deployment/run time. You can technically choose all those 
locations manually if you _really_ want to.

Use convention over configuration and spare yourself the headache.

IMPORTS, however, are quite practical also in the conventional case. And 
you always need DEPENDENCIES if you are using types from a different QML 
module in the QML interface to your C++-defined components.

best regards,
Ulf Hermann


More information about the Interest mailing list