Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 4.8.0-beta1
-
None
-
5e9bf26fb34f44225168bc6f03a12ef7cbb52601 (qt-creator/tqtc-plugin-qmlpreview/4.8)
Description
We're using Utils::FileInProjectFinder to resolve target paths back to paths on the host. This is fundamentally a heuristic, which tries to match a maximum common postfix between the target path and any files found in the project, in search paths, or in the sysroot.
There can be many files called "qmldir" in a project, as each QML component not implicitly defined by files in a directory needs to have one of those. The QML engine speculatively asks for qmldir files in various paths when trying to resolve a component name. It will also ask for files that don't exist on the target, but we cannot determine that on the target side because we might be running without deployment or the user might have added extra files during the current preview session.
Therefore, the path resolution heuristic in FileInProjectFinder will sometimes send wrong qmldir files for some of those requests. This is fatal for the preview, as the resulting QML components don't match what the application expects.
Attachments
For Gerrit Dashboard: QTCREATORBUG-21107 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
240420,4 | FileInProjectFinder: Report length of matched postfix | 4.8 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |
240421,2 | QtSupport: When populating file finder, map resource paths | 4.8 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |
240422,3 | Accept only files FileInProjectFinder is 100% confident about | 4.8 | {graveyard}/qt-creator/tqtc-plugin-qmlpreview | Status: MERGED | +2 | 0 |