Qt Declarative (Quick 2)
Go to file
Ulf Hermann ecf78f3190 QmlCompiler: Properly handle uncertain component status
In order to determine whether an ID is visible from a referrer we need
not only determine the component boundaries of the referrer, but also
those of the candidate elements with the respective ID. Rewrite the
logic to have QQmlJSScopesById handle this. It has to iterate the
respective elements anyway and can therefore easily check if one of them
is assigned to an unknown property. It now provides low-level methods
that output all possible candidates for an ID, while also stating the
confidence associated with them. The plain id() and scope() methods only
return results we are actually certain about.

In places where we generate warnings or can allow for some fuzzy
results, we use the low-level methods, since those generally produce
more informative results.

The QML DOM was passing the JavaScript global object as referrer to the
scope() method before. This happened to work but was, of course, wrong.
Make sure that ID elements in the DOM receive a proper QML scope to
avoid that.

Pick-to: 6.10 6.9 6.8
Task-number: QTBUG-140041
Change-Id: I41cf8603ae6a5d5461d3c12d74521e68b5e28ea4
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2025-09-18 23:24:23 +02:00
LICENSES Add REUSE.toml files and missing licenses 2024-10-29 14:00:19 +02:00
cmake Use `_qt_internal_set_source_file_generated` 2025-06-24 14:07:30 +02:00
coin Make module ready for source SBOM checking 2025-02-21 20:24:43 +01:00
dist Remove year from Qt Copyright in REUSE.toml 2025-07-14 09:47:02 +02:00
examples CMake: Guard examples that use Svg in a qt build without Svg 2025-09-16 09:03:29 +02:00
features
src QmlCompiler: Properly handle uncertain component status 2025-09-18 23:24:23 +02:00
tests QmlCompiler: Properly handle uncertain component status 2025-09-18 23:24:23 +02:00
tools QmlCompiler: Properly handle uncertain component status 2025-09-18 23:24:23 +02:00
.cmake.conf Bump version to 6.11.0 2025-06-14 02:36:26 +01:00
.gitattributes
.gitignore QtQml: Drop checks for compile hash and Qt version from the CUs 2025-03-18 10:53:07 +01:00
.gitmodules
.gitreview Add .gitreview file 2025-02-26 20:54:40 +01:00
.tag
CMakeLists.txt qt_target_qml_from_svg() command in cmake 2025-08-14 07:36:25 +02:00
README.md
REUSE.toml Remove year from Qt Copyright in REUSE.toml 2025-07-14 09:47:02 +02:00
configure.cmake Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-09-07 17:01:30 +02:00
dependencies.yaml Update dependencies on 'dev' in qt/qtdeclarative 2025-09-18 06:59:44 +00:00
licenseRule.json Use new qt_target_qml_from_svg() function for examples 2025-08-21 12:55:54 +02:00
qt_cmdline.cmake Remove "2" from Qt Quick Controls directories 2022-12-01 10:26:20 +08:00
qtdeclarative.doxy