aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols2/basic/qtquickcontrols2basicstyleplugin.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-07-26 15:25:08 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-09 17:14:15 +0000
commitaea1336f9e7be7e85d2286b2a388341fda6b61ae (patch)
tree9dbb68c93ec7edb5b1263ba5345f27ac42d4b44a /src/quickcontrols2/basic/qtquickcontrols2basicstyleplugin.cpp
parent238cabefad95db38e24fdb49f0106098a1e4466e (diff)
QQmlIRBuilder: Always preserve "undefined" string
QQmlIRBuilder skips storing binding scripts as a string to save memory. However, for QQmlScriptString, we need the string to be available. This is solved by running QQmlScriptStringScanner in the type compiler at runtime, which sets the correct stringIndex for script string bindings. However, that one does not run when we already have a compilation unit from cachegen (and if we would run it unconditionally, we still would miss the source code to recover the string). We work around this issue by noting that QQmlScriptString only cares about a very limited set of strings: Namely the various literals and undefined. The literals are already correctly handled, as IRBuilder has specific optimizations for them anyway. We now check in the generic case whether the bindings string equals "undefined", and if so, ensure that the string is registered. Fixes: QTBUG-91165 Change-Id: I4c4696952a082d1e69e0c9e5a0b9bf2470d59187 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit dd86881520dde6c1487e5397f10b82584e6b9eaa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quickcontrols2/basic/qtquickcontrols2basicstyleplugin.cpp')
0 files changed, 0 insertions, 0 deletions