[Qbs] Qt Quick Tests and custom import paths
Christian Kandeler
christian.kandeler at qt.io
Tue May 15 16:25:28 CEST 2018
On Tue, 15 May 2018 15:52:44 +0200
Federico Frenguelli <synasius at gmail.com> wrote:
> I'm not a QtQuick expert, but can't you just use the QML2_IMPORT_PATH
> > variable?
> >
> > AutotestRunner {
> > environment: base.concat("QML2_IMPORT_PATH=qrc:/qml")
> > }
> >
>
> I tried to use environment exactly how you proposed but somehow the value
> of QML2_IMPORT_PATH is processed and qrc:/qml is not added to the list.
> Interesting is that if I set environment to
>
> environment: base.concat("QML2_IMPORT_PATH=qrc:/qml:/home")
>
> this is the resulting list of import paths:
>
> View: QQuickView, import paths:
> '/home/<user>/workspace/<project>/debug/tst-components-default.f0fbc580'
> 'qrc:/qt-project.org/imports'
> '/home'
> '/home/<user>/Qt/5.9.5/gcc_64/qml'
>
> qrc:/qml has been removed.
Interesting. If you run qbs with "--command-echo-mode
command-line-with-environment", you can see exactly what environment qbs passes to the application.
Although now that I think of it, the colon might be the problem, as QtQuick probably interprets it as a path separator and then throws away the "qrc" and "/qml" parts, because they are not existing paths. Maybe it's not possible to provide qrc paths in this variable...
Christian
More information about the Qbs
mailing list