diff options
| author | Sami Shalayel <sami.shalayel@qt.io> | 2025-06-24 13:45:36 +0200 |
|---|---|---|
| committer | Sami Shalayel <sami.shalayel@qt.io> | 2025-07-07 19:35:20 +0200 |
| commit | 210f2c8a40460725b6d422b5d844576296ff3bf9 (patch) | |
| tree | 1d90d448502466a5e6b37eb57e1839e1199130b9 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | a3699e3e5cddb5dfca21179f6bd1bc9d88caee5a (diff) | |
qqmljsscope: add line number for Components
Add Component line number information from MOC into QQmlJSScopes. That
is needed for qmlls to find definitions of QML components defined in
C++ headers.
This change adds the line number information into the generated qmltypes
from MOCs JSON, and reads it back into a QQmlJSScope.
Instead of adding an extra member, re-use the QQmlJSSourceLocation that
is inside the QQmlJSScope. Set the column to 1 for it to be valid and
to simplify some code on the qmlls side. This allows to treat a
sourcelocation in the same way, independently if the component described
by the QQmlJSScope was defined in QML or C++.
Avoid an assertion in QQmlJSImportVisitor::checkRequiredProperties()
where printFix assumes that a file can be opened if its source location
is valid: this change adds have valid sourcelocations to qml components
defined in C++, but QQmlJSScope::filePath() can't be opened because it
only contains the filename, not the file path.
Task-number: QTBUG-128393
Change-Id: Idf4acc32cff60730528322286ad4ba726b502ac1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
0 files changed, 0 insertions, 0 deletions
