QML2_IMPORT_PATH not working?
-
wrote on 6 Jun 2021, 05:25 last edited by Diracsbracket 6 Jun 2021, 06:09
Hi.
I am trying to run theqmltests
test program frombluez-qt
.
I cross-built from source and deployedbluez-qt
to the Pi4 in/usr/local
.The tests are being built alright, but are not automatically deployed, so I copied them manually to
/home/pi/test-bluez-qt/bin
and additionally copied theautotests
dir from thebluez-qt
source dir to it, to have access to thetst_***.qml
files apparently required byqmltests
.Then, I try to run
qmltests
as follows:pi@raspberrypi:~/test-bluez-qt$ QML_IMPORT_TRACE=1 LD_LIBRARY_PATH=/home/pi/test-bluez-qt/bin QML2_IMPORT_PATH=/usr/local/lib/qml ./bin/qmltests
This gives the following output:
QQmlImportDatabase::addImportPath: "/usr/local/Qt5.15.2/qml" QQmlImportDatabase::addImportPath: "/home/dirac/build-bluez-qt-Pi4B-Debug/autotests/../src/imports" QQmlImportDatabase::addImportPath: "qrc:/qt-project.org/imports" QQmlImportDatabase::addImportPath: "/home/pi/test-bluez-qt/bin" QQmlImports(file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml)::addLibraryImport: "QtTest" 1.0 as "" QQmlImports(file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml)::importExtension: loaded "/usr/local/Qt5.15.2/qml/QtTest/qmldir" QQmlImportDatabase::registerPluginTypes: "QtTest" from "/usr/local/Qt5.15.2/qml/QtTest" QQmlImports(file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml)::addLibraryImport: "QtQuick" 2.2 as "" QQmlImports(file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml)::importExtension: loaded "/usr/local/Qt5.15.2/qml/QtQuick.2/qmldir" QQmlImportDatabase::registerPluginTypes: "QtQuick" from "/usr/local/Qt5.15.2/qml/QtQuick.2" QQmlImports(file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml)::addLibraryImport: "org.kde.bluezqt.fakebluez" 1.0 as "" file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml:10:1: module "org.kde.bluezqt" is not installed import org.kde.bluezqt 1.0 as BluezQt ^ pi@raspberrypi:~/test-bluez-qt$
The error is:
file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml:10:1: module "org.kde.bluezqt" is not installed import org.kde.bluezqt 1.0 as BluezQt ^
However, the path set in
QML2_IMPORT_PATH
i.e./usr/local/lib/qml
contains theorg.kde.bluezqt
module:pi@raspberrypi:/usr/local/lib/qml/org/kde/bluezqt$ ls DevicesModel.qml libbluezqtextensionplugin.so qmldir pi@raspberrypi:/usr/local/lib/qml/org/kde/bluezqt$
and
qmldir
is as follows:pi@raspberrypi:/usr/local/lib/qml/org/kde/bluezqt$ cat qmldir module org.kde.bluezqt plugin bluezqtextensionplugin DevicesModel 1.0 DevicesModel.qml
How can I resolve this?
Thanks! -
Hi.
I am trying to run theqmltests
test program frombluez-qt
.
I cross-built from source and deployedbluez-qt
to the Pi4 in/usr/local
.The tests are being built alright, but are not automatically deployed, so I copied them manually to
/home/pi/test-bluez-qt/bin
and additionally copied theautotests
dir from thebluez-qt
source dir to it, to have access to thetst_***.qml
files apparently required byqmltests
.Then, I try to run
qmltests
as follows:pi@raspberrypi:~/test-bluez-qt$ QML_IMPORT_TRACE=1 LD_LIBRARY_PATH=/home/pi/test-bluez-qt/bin QML2_IMPORT_PATH=/usr/local/lib/qml ./bin/qmltests
This gives the following output:
QQmlImportDatabase::addImportPath: "/usr/local/Qt5.15.2/qml" QQmlImportDatabase::addImportPath: "/home/dirac/build-bluez-qt-Pi4B-Debug/autotests/../src/imports" QQmlImportDatabase::addImportPath: "qrc:/qt-project.org/imports" QQmlImportDatabase::addImportPath: "/home/pi/test-bluez-qt/bin" QQmlImports(file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml)::addLibraryImport: "QtTest" 1.0 as "" QQmlImports(file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml)::importExtension: loaded "/usr/local/Qt5.15.2/qml/QtTest/qmldir" QQmlImportDatabase::registerPluginTypes: "QtTest" from "/usr/local/Qt5.15.2/qml/QtTest" QQmlImports(file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml)::addLibraryImport: "QtQuick" 2.2 as "" QQmlImports(file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml)::importExtension: loaded "/usr/local/Qt5.15.2/qml/QtQuick.2/qmldir" QQmlImportDatabase::registerPluginTypes: "QtQuick" from "/usr/local/Qt5.15.2/qml/QtQuick.2" QQmlImports(file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml)::addLibraryImport: "org.kde.bluezqt.fakebluez" 1.0 as "" file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml:10:1: module "org.kde.bluezqt" is not installed import org.kde.bluezqt 1.0 as BluezQt ^ pi@raspberrypi:~/test-bluez-qt$
The error is:
file:///home/pi/test-bluez-qt/bin/autotests/qml/tst_adapter.qml:10:1: module "org.kde.bluezqt" is not installed import org.kde.bluezqt 1.0 as BluezQt ^
However, the path set in
QML2_IMPORT_PATH
i.e./usr/local/lib/qml
contains theorg.kde.bluezqt
module:pi@raspberrypi:/usr/local/lib/qml/org/kde/bluezqt$ ls DevicesModel.qml libbluezqtextensionplugin.so qmldir pi@raspberrypi:/usr/local/lib/qml/org/kde/bluezqt$
and
qmldir
is as follows:pi@raspberrypi:/usr/local/lib/qml/org/kde/bluezqt$ cat qmldir module org.kde.bluezqt plugin bluezqtextensionplugin DevicesModel 1.0 DevicesModel.qml
How can I resolve this?
Thanks!wrote on 6 Jun 2021, 05:55 last edited by Diracsbracket 6 Jun 2021, 06:12I ended up copying the
org
dir to the~/test-bluez-qt/bin
dir so that it is in the default module search path as described at
https://doc.qt.io/qt-5/qtqml-syntax-imports.html#qml-import-pathI could also have copied the whole module dir to my Qt installation's
qml
dir in/usr/local/Qt5.15.2/qml
, as suggested by the trace output from the above test:QQmlImportDatabase::addImportPath: "/usr/local/Qt5.15.2/qml"
The qml test then runs correctly.
But still no idea why using theQML2_IMPORT_PATH
does not work
1/2