Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.3.0 Beta3
-
8a9607acfc (qt/qtdeclarative/dev) f3446ed36b (qt/qtdeclarative/6.3)
Description
Using import ... as instead of import
import ui as Test Window { id: window property int state Component.onCompleted: { console.log(Test.WindowState.TILT) window.state = Test.WindowState.OPEN console.log(window.state) } }
leads to compiler warnings
Warning: main.qml:15:26: Type not found in namespace console.log(Test.WindowState.TILT) ^^^^^^^^^^^ Warning: main.qml:15:26: Property "WindowState" not found on type "Window" console.log(Test.WindowState.TILT) ^^^^^^^^^^^ Warning: main.qml:15:26: Could not compile binding for onCompleted: Cannot load property WindowState from import namespace 2. console.log(Test.WindowState.TILT) ^^^^^^^^^^^
, the result works, though. These messages are gone, if you remove Test.
Additionally: why isn't it possible to use something like
property WindowState state
?
Attachments
For Gerrit Dashboard: QTBUG-101811 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
401081,2 | QmlCompiler: Support type lookups in prefix-imported modules | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
401952,5 | QmlCompiler: Support type lookups in prefix-imported modules | 6.3 | qt/qtdeclarative | Status: MERGED | +2 | 0 |