[Qbs] Application with QML_ELEMENT in library, problem with plugins.qmltypes

Stéphane Fabry sf at xris.eu
Tue May 14 14:04:29 CEST 2024


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
<qbs at qt-project.org> 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 at qt-project.org
> 
> https://lists.qt-project.org/listinfo/qbs


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20240514/56fd0ca3/attachment.htm>


More information about the Qbs mailing list