[Interest] Qt 6.5.2 and qmllint questions/issues

Ulf Hermann ulf.hermann at qt.io
Thu Aug 31 13:51:25 CEST 2023


> Another issue we are having with qmllint is adding type information for 
> objects added to the global object in C++. We've used this to provide 
> custom log and assert functions, but obviously the linter doesn't know 
> about them. If they are added to qml/jsroot.qmltypes (along similar 
> lines to the 'Console' type) then the linter does know about the type.

The point of the linker is to warn you about QML constructs we cannot 
compile to C++. jsroot.qmltypes is supposed to only contain information 
about types built into QtQml itself, so that we can make strong 
assumptions about where to find the respective functionality when 
generating C++ code. Please don't add anything to it.

You should define singletons if you need to add globally accessible 
functionality. A singleton can have methods, and access to a known 
singleton can be compiled to C++.

best regards,
Ulf Hermann


More information about the Interest mailing list