Details
Description
The `qmlcachegen` tool that generates bytecode for QML behaves differently than when not using pre-compiled QML files (when caching the files at runtime). Please see attached zip-file.
The line
property var eF: Main.Foo
appears similarly in our real code and is intended to create a "shortcut" for the long enumeration name. It has been there for a considerable time and much code relies on this to work in our codebase. However, when we changed to CMake and using the builtin qmlcachegen, it doesn't work anymore and `eF.Bar` yields `undefined`.
property int bar: eF.Bar
[12:54:06.595] warning: qrc:/qt/qml/reproduce/Main.qml:14:5: Unable to assign [undefined] to int
If you add "NO_CACHEGEN", it works as expected, but you won't get syntax-checking at compile time anymore.
Attachments
For Gerrit Dashboard: QTBUG-119090 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
519314,3 | QmlCompiler: Do not generate lookups for bare meta enums | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
519587,2 | QmlCompiler: Do not generate lookups for bare meta enums | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
519594,3 | QmlCompiler: Do not generate lookups for bare meta enums | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |
519830,1 | QmlCompiler: Do not generate lookups for bare meta enums | tqtc/lts-6.2 | qt/tqtc-qtdeclarative | Status: ABANDONED | 0 | 0 |
519894,2 | Do not generate lookups for bare meta enums | tqtc/lts-6.2 | qt/tqtc-qmlcompilerplus | Status: MERGED | +2 | 0 |