diff options
author | Sami Shalayel <sami.shalayel@qt.io> | 2024-04-05 11:04:22 +0200 |
---|---|---|
committer | Sami Shalayel <sami.shalayel@qt.io> | 2024-04-23 20:33:38 +0200 |
commit | c2a65fbe04bbcac066a8bf1527d064d4866efbfe (patch) | |
tree | a9fc4a62c2d3aa64a35bc15afa9c270528135af7 /tools | |
parent | 0559256ddea974d43f971b05c62e61ad76437697 (diff) |
qqmljsscope: add ownModuleName
Allow qqmljsscopes of QML components to have "own" module names, and
add a helper method moduleName() that helps retrieve the module name
of some (possibly non QML component) qqmljsscope by iterating over its
parents.
That is required for the renaming of qmlcomponents and allows to check
if the qml element to be renamed is defined in the same module as the
current module. (It is not allowed to rename a QML component from
another module).
Task-number: QTBUG-114993
Change-Id: I09d57ec87cfc64de31859b2af6334264c4fa6912
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmltc/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/qmltc/main.cpp b/tools/qmltc/main.cpp index 0541203571..a310c3d3c6 100644 --- a/tools/qmltc/main.cpp +++ b/tools/qmltc/main.cpp @@ -273,7 +273,7 @@ int main(int argc, char **argv) auto currentScope = QQmlJSScope::create(); if (parser.isSet(moduleOption)) - currentScope->setModuleName(parser.value(moduleOption)); + currentScope->setOwnModuleName(parser.value(moduleOption)); QmltcVisitor visitor(currentScope, &importer, &logger, QQmlJSImportVisitor::implicitImportDirectory(url, &mapper), qmldirFiles); |