Re: [Qbs] Application with QML_ELEMENT in library, problem with plugins.qmltypes
Oh thanks, i miss that property and i was trying to install through a group like this: Group { fileTagsFilter: "qt.qml.types" qbs.install: true } Yes it seems QtCreator look for those only in the application build directory (in the shadow build) but that path is not available afaik from other plugins/libraries. My workaround is to deploy to the installRoot like a qml module: - subdirectory with module name (or more if module name is dot separated) - building a qmldir file with "typeinfo plugins.qmltypes" - deploy both qmldir and "plugins.qmltypes" (and i was hitting the wall on this one) - set "qmlImportPaths" to the installRoot That's a lot of plumbering but it works. Thanks Christian ! STÉPHANE FABRY , C.O.O. & Software Manager T: +32 4 367 07 92 [tel:+3243670792] _X-Ray Imaging Solutions_ | www.xris.eu [http://www.xris.eu/] Le 2024-05-14T13:43:52.000+02:00, Christian Kandeler via Qbs a écrit : > On 5/14/24 10:11 AM, Stéphane Fabry wrote: >>> -> i took the "plugins.qmltypes" located in >>> "Release_Desktop__6bebb707edc597ff\carlib.83bede55" and copy >>> paste manually in the app build dir >>> ("Release_Desktop__6bebb707edc597ff\app.7d104347") and there it >>> is working. >> >> But i have no clue on how to ask the library to >> build/install/deploy its own qmltypes in the build directory of >> the application :/ > > You need to arrange this yourself by defining suitable *install* > > locations that are shared among the products involved, e.g. via a > > project-level property. > > So if the application and the qmltypes file have to be at the same > > location (surely that's not the canonical way? but I'm not a QML > > expert), then they need to get the same qbs.installDir value. > Installing > > the .qmltypes file is achieved by setting Qt.qml.typesInstallDir > (see > > https://doc.qt.io/qbs/qml-qbsmodules-qt-qml.html#typesInstallDir-prop). > > Christian > > ___ > > 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
Re: [Qbs] Application with QML_ELEMENT in library, problem with plugins.qmltypes
On 5/14/24 10:11 AM, Stéphane Fabry wrote: -> i took the "plugins.qmltypes" located in "Release_Desktop__6bebb707edc597ff\carlib.83bede55" and copy paste manually in the app build dir ("Release_Desktop__6bebb707edc597ff\app.7d104347") and there it is working. But i have no clue on how to ask the library to build/install/deploy its own qmltypes in the build directory of the application :/ You need to arrange this yourself by defining suitable *install* locations that are shared among the products involved, e.g. via a project-level property. So if the application and the qmltypes file have to be at the same location (surely that's not the canonical way? but I'm not a QML expert), then they need to get the same qbs.installDir value. Installing the .qmltypes file is achieved by setting Qt.qml.typesInstallDir (see https://doc.qt.io/qbs/qml-qbsmodules-qt-qml.html#typesInstallDir-prop). Christian ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
Re: [Qbs] Application with QML_ELEMENT in library, problem with plugins.qmltypes
I want QtCreator to load both app.qmltypes and all plugins.qmltypes of the dependent libraries (this small project i have only one). -> i took the "plugins.qmltypes" located in "Release_Desktop__6bebb707edc597ff\carlib.83bede55" and copy paste manually in the app build dir ("Release_Desktop__6bebb707edc597ff\app.7d104347") and there it is working. But i have no clue on how to ask the library to build/install/deploy its own qmltypes in the build directory of the application :/ STÉPHANE FABRY , C.O.O. & Software Manager T: +32 4 367 07 92 [tel:+3243670792] _X-Ray Imaging Solutions_ | www.xris.eu [http://www.xris.eu/] Le 2024-05-14T09:51:45.000+02:00, Christian Kandeler via Qbs a écrit : > On 5/14/24 9:17 AM, Stéphane Fabry via Qbs wrote: >> The projet is running fine, the problem lies in the QtCreator >> loading >> >> the qmltypes. >> >> It loads correctly the "app.qmltypes" located next to the app.exe >> but >> >> it won't load the library "plugins.qmltypes" located next to the >> dll. >> >> Did I miss something ? > > You mean you want Qt Creator to pick up the import that is being > > generated when building that very same project to which Main.qml > belongs? > > Christian > > ___ > > 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
Re: [Qbs] Application with QML_ELEMENT in library, problem with plugins.qmltypes
On 5/14/24 9:17 AM, Stéphane Fabry via Qbs wrote: The projet is running fine, the problem lies in the QtCreator loading the qmltypes. It loads correctly the "app.qmltypes" located next to the app.exe but it won't load the library "plugins.qmltypes" located next to the dll. Did I miss something ? You mean you want Qt Creator to pick up the import that is being generated when building that very same project to which Main.qml belongs? Christian ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
[Qbs] Application with QML_ELEMENT in library, problem with plugins.qmltypes
Hi, Here is a small example project with a QtQuick app and a C++ library. Both are separate Product in the qbs Project, both define a class declared with QML_ELEMENT and are imported into the Main.qml The Qml import is declared with: Qt.qml.importName: "People" Qt.qml.importVersion: "1.0" The projet is running fine, the problem lies in the QtCreator loading the qmltypes. It loads correctly the "app.qmltypes" located next to the app.exe but it won't load the library "plugins.qmltypes" located next to the dll. Did I miss something ? I'm very close to heaven, does someone has an idea how to solve this ? Thanks Main.qml import QtQuick import People 1.0 import Cars 1.0 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Person { id: bob name: "Bob Jones" shoeSize: 12 } Lotus { id: car name: "emira" mainColor: "blue" } Text { anchors.centerIn: parent text: bob.name + " drives " + car.name } } STÉPHANE FABRY , C.O.O. & Software Manager T: +32 4 367 07 92 [tel:+3243670792] _X-Ray Imaging Solutions_ | www.xris.eu [http://www.xris.eu/] <> ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs