I added a fix for this, though I am not sure if that is the correct fix or only 
a work-around:

I inserted a line 

    foreignTypes = Array.from(new Set(foreignTypes)); // remove duplicates

into function typeRegistrarCommands() in qml.js of the Qt module provider 
template. This removed the duplicates from the array and the
warnings are gone.

Is that the correct solution? Should I open an issue for this?

Regards, Jochen


Am Dienstag, dem 22.07.2025 um 22:17 +0200 schrieb Jochen Becher via Qbs:
> Hi,
> 
> With qbs 3.0.0 I get hundred of thousands (litterally!) warnings from qbs 
> saying that some Qt types are defined twice:
> 
> Warning: qabstractitemmodel.h:258: Multiple C++ types called 
> QAbstractItemModel found!
>  (other occurrence in : qabstractitemmodel.h : 258 )
>  This violates the One Definition Rule!
> 
> Here is the command that was called. Any idea why this happens? I am pretty 
> sure the .json files should not be listed with that many
> duplicates, shouldn't they?
> 
> Regards, Jochen
> 
> 
> /home/becherj/Qt/Online/6.8.3/gcc_64/libexec/qmltyperegistrar 
> --generate-qmltypes=/home/becherj/projects/trunk/navapps/target/stp_spine-build/qtc_linux64_gcc_qt6.8.3-debug/framework-quantum-service-
> image-preview.e6b3400b/plugins.qmltypes 
> --import-name=Stp.ImagePreview 
> --major-version=1 
> --minor-version=0 
> --foreign-types=
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6concurrent_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6concurrent_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6core_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6gui_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6network_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6opengl_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6opengl_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6opengl_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6opengl_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6opengl_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6opengl_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6opengl_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qml_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlmeta_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlmeta_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlmeta_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlmeta_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlmeta_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlmeta_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlmodels_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlmodels_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlmodels_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlmodels_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlmodels_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlmodels_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlworkerscript_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlworkerscript_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlworkerscript_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlworkerscript_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlworkerscript_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6qmlworkerscript_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6quick_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6quick_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6quick_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6quick_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6quick_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6quick_relwithdebinfo_metatypes.json,
> /home/becherj/Qt/Online/6.8.3/gcc_64/metatypes/qt6widgets_relwithdebinfo_metatypes.json
>  
> -o 
> /home/becherj/projects/trunk/navapps/target/stp_spine-build/qtc_linux64_gcc_qt6.8.3-debug/framework-quantum-service-image-
> preview.e6b3400b/framework_quantum_service_image_previewd_qmltyperegistrations.cpp
>  
> /home/becherj/projects/trunk/navapps/target/stp_spine-build/qtc_linux64_gcc_qt6.8.3-debug/framework-quantum-service-image-
> preview.e6b3400b/framework_quantum_service_image_previewd_metatypes.json
> _______________________________________________
> Qbs mailing list
> Qbs@qt-project.org
> https://lists.qt-project.org/listinfo/qbs

_______________________________________________
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs

Reply via email to