Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.0
-
a29eb1c15200363a175c1b3a9ad2189b63b9765f (qt/qtdeclarative/dev)
Description
For simple project bellow qmllint (build from dev branch) reports,
Warning: unqualified access at main.qml:14:20 return Foo.f("User"); ^^^
what is rather strange, for .qml object imported in similar way all fine,
but javascript for some reason is bad.
I also tried syntax like:
import "Foo.js" as Foo
and it partly works. It works for file system access to qml + javascript code,
but for real program code with "qrc:/" as prefix it reports the same unqualified access.
qmlscene handle the first variant just fine.
//$ cat main.qml import QtQuick 2.15 import QtQuick.Window 2.15 import MyModule 1.0 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") Text { anchors.centerIn: parent text: { return Foo.f("User"); } } }
//$ cat MyModule/qmldir
module MyModule
Foo 1.0 Foo.js
//$ cat MyModule/Foo.js .pragma library function f(name) { return "Hi, " + name }