Details
-
Type:
Bug
-
Status: Open
-
Priority:
P2: Important
-
Resolution: Unresolved
-
Affects Version/s: 5.15.3, 6.0, 6.1, 6.2
-
Fix Version/s: 6.4
-
Component/s: QML: Declarative and Javascript Engine
-
Labels:
-
Platform/s:
Description
A qml file imports a javascript file like this:
import 'qrc:/example.js' as E
In that same file, a inline component is defined and instantiated, which uses a function of that js file:
component MyText : Text { text: E.func() } MyText {}
The expectation is that the binding to the text property is (correctly) evaluated when the inline component is instantiated. Instead, an error is thrown:
TypeError: Cannot call method 'func' of null
I tested on 5.15.3 on Linux only, but I expect the same behaviour on all platforms.
Please find the attached minimal example to produce this error.