<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qt/qtdeclarative.git/tests/auto/qml/qmllint/data, branch dev</title>
<subtitle>Qt Declarative (Quick 2)
</subtitle>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/'/>
<entry>
<title>Revert "Parser: Warn about QML files without imports"</title>
<updated>2026-05-12T07:54:15+00:00</updated>
<author>
<name>Olivier De Cannière</name>
<email>olivier.decanniere@qt.io</email>
</author>
<published>2026-05-11T08:47:20+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=66222b9d5af9c77dc040a5ccf2fd67781abecb6f'/>
<id>66222b9d5af9c77dc040a5ccf2fd67781abecb6f</id>
<content type='text'>
This reverts commit fb654eed74ac94807a8bba22f0b4b17c4b37fd13.

Reason for revert: Documents without imports are valid

Change-Id: I074e2ec573a4df428fb98573f52bdd93d6f6e279
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit fb654eed74ac94807a8bba22f0b4b17c4b37fd13.

Reason for revert: Documents without imports are valid

Change-Id: I074e2ec573a4df428fb98573f52bdd93d6f6e279
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Parser: Warn about QML files without imports</title>
<updated>2026-05-05T06:30:58+00:00</updated>
<author>
<name>Olivier De Cannière</name>
<email>olivier.decanniere@qt.io</email>
</author>
<published>2026-04-23T08:39:22+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=fb654eed74ac94807a8bba22f0b4b17c4b37fd13'/>
<id>fb654eed74ac94807a8bba22f0b4b17c4b37fd13</id>
<content type='text'>
Our documentation claims imports are non-optional. This is not actual
true. The parser is happy with such files and the compiler can even
generate C++ code for them.

This can work in simple cases because the QML module is always imported
even when not explicitly asked by the user. Therefore, types such as
QtObject are still available.

However, this is not the case of most types and we want to point our
users to the likely source of their issues instead of showing them
more cryptic errors that result from the missing imports.

Note that Parser::parse() still cannot return false on files with no
imports, as that breaks qmlls. We want to accept such files and show
diagnostics instead of nothing.

Change-Id: Iffc2c628e681ae576d7b4f0bd309908044805616
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Our documentation claims imports are non-optional. This is not actual
true. The parser is happy with such files and the compiler can even
generate C++ code for them.

This can work in simple cases because the QML module is always imported
even when not explicitly asked by the user. Therefore, types such as
QtObject are still available.

However, this is not the case of most types and we want to point our
users to the likely source of their issues instead of showing them
more cryptic errors that result from the missing imports.

Note that Parser::parse() still cannot return false on files with no
imports, as that breaks qmlls. We want to accept such files and show
diagnostics instead of nothing.

Change-Id: Iffc2c628e681ae576d7b4f0bd309908044805616
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>qmllint: warn on singleton mismatch in LinterVisitor</title>
<updated>2026-04-16T17:33:06+00:00</updated>
<author>
<name>Sami Shalayel</name>
<email>sami.shalayel@qt.io</email>
</author>
<published>2026-04-01T10:50:10+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=93e6d7bc8e81bf4b82ebda6edc3ee40ef1123bb4'/>
<id>93e6d7bc8e81bf4b82ebda6edc3ee40ef1123bb4</id>
<content type='text'>
Move the warning from the QDeferredFactory&lt;QQmlJSScope&gt; to the
LinterVisitor. Adapt a test to expect the warning only on the singleton
file, instead of the previous behavior of seeing the warnings on all qml
files importing the QML module with the faulty singleton. Remove the
test files that imported the faulty QML Module.

Set the singleton flag on QQmlJSScope in the importer based on the
singleton entry in the qmldir instead of using the singleton pragma
value. This mimics the way the QML Engine ignores the singleton pragma
value.

Move m_rootIsSingleton from QQmlJSImportVisitor to LinterVisitor now
that its unused in QQmlJSImportVisitor.

Change-Id: I398738c816fbd273c51626954860a724b3110990
Reviewed-by: Olivier De Cannière &lt;olivier.decanniere@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the warning from the QDeferredFactory&lt;QQmlJSScope&gt; to the
LinterVisitor. Adapt a test to expect the warning only on the singleton
file, instead of the previous behavior of seeing the warnings on all qml
files importing the QML module with the faulty singleton. Remove the
test files that imported the faulty QML Module.

Set the singleton flag on QQmlJSScope in the importer based on the
singleton entry in the qmldir instead of using the singleton pragma
value. This mimics the way the QML Engine ignores the singleton pragma
value.

Move m_rootIsSingleton from QQmlJSImportVisitor to LinterVisitor now
that its unused in QQmlJSImportVisitor.

Change-Id: I398738c816fbd273c51626954860a724b3110990
Reviewed-by: Olivier De Cannière &lt;olivier.decanniere@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>qmllint: warn on file selector in linterVisitor</title>
<updated>2026-04-07T11:19:23+00:00</updated>
<author>
<name>Sami Shalayel</name>
<email>sami.shalayel@qt.io</email>
</author>
<published>2026-03-24T13:58:38+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=7097e296e34ebac35486b9bd8b867ebd0cd0f852'/>
<id>7097e296e34ebac35486b9bd8b867ebd0cd0f852</id>
<content type='text'>
Move the file selector warning from QQmlJSImporter to LinterVisitor, as
the importer can't access the fields of scopes to check if file-selected
scopes are compatible to their original scopes, while the LinterVisitor
can. Use opt-in 'import-file-selector' warning category to warn on types that
are file-selected but "compatible", and use opt-out 'import' category to
warn on incompatible file-selected types.

This changes the way we warn on file selected components. Previously, we
would warn about all file selected components in an imported module,
even if the QML file was not part of the QML module with the
file-selected QML components. Also, we need to disable the
"TolerateFileSelectors" flag during module linting so that we still warn
about file selected files during module linting (we don't seem to
currently run the import visitor when doing module linting).

Now, we only warn in the actually file-selected QML components, so if we
have:
* Toolbar.qml
* Broken.qml
* +Material/ToolBar.qml
* +Material/Broken.qml,
for example, then qmllint will warn in
* ToolBar.qml and
* +Material/ToolBar.qml
about ToolBar being file selected or potentially compatible. We don't
complain about Broken.qml.

Similarly, qmllint wil complain on the Broken.qml files about Broken
using file selectors without mentioning the unrelated ToolBar.qml

Support file selected variants in QQmlJS::ContextualTypes, and separate
them from the actual types. Use the TolerateFileSelectors flag in
QQmlJSImporter to keep the previous way of warning during compilation.

Pick-to: 6.11
Fixes: QTBUG-145074
Change-Id: I492cfc71818c3a3f83e50e89152f3d0ee71a0283
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the file selector warning from QQmlJSImporter to LinterVisitor, as
the importer can't access the fields of scopes to check if file-selected
scopes are compatible to their original scopes, while the LinterVisitor
can. Use opt-in 'import-file-selector' warning category to warn on types that
are file-selected but "compatible", and use opt-out 'import' category to
warn on incompatible file-selected types.

This changes the way we warn on file selected components. Previously, we
would warn about all file selected components in an imported module,
even if the QML file was not part of the QML module with the
file-selected QML components. Also, we need to disable the
"TolerateFileSelectors" flag during module linting so that we still warn
about file selected files during module linting (we don't seem to
currently run the import visitor when doing module linting).

Now, we only warn in the actually file-selected QML components, so if we
have:
* Toolbar.qml
* Broken.qml
* +Material/ToolBar.qml
* +Material/Broken.qml,
for example, then qmllint will warn in
* ToolBar.qml and
* +Material/ToolBar.qml
about ToolBar being file selected or potentially compatible. We don't
complain about Broken.qml.

Similarly, qmllint wil complain on the Broken.qml files about Broken
using file selectors without mentioning the unrelated ToolBar.qml

Support file selected variants in QQmlJS::ContextualTypes, and separate
them from the actual types. Use the TolerateFileSelectors flag in
QQmlJSImporter to keep the previous way of warning during compilation.

Pick-to: 6.11
Fixes: QTBUG-145074
Change-Id: I492cfc71818c3a3f83e50e89152f3d0ee71a0283
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>qmljsimporter: don't test incomplete types with file selectors</title>
<updated>2026-04-07T11:19:08+00:00</updated>
<author>
<name>Sami Shalayel</name>
<email>sami.shalayel@qt.io</email>
</author>
<published>2026-03-24T17:27:35+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=6e4eb4bcd76c4f857158c167f030c9df7acfd82d'/>
<id>6e4eb4bcd76c4f857158c167f030c9df7acfd82d</id>
<content type='text'>
Don't warn in the importer on types where qqmljsimportvisitor didn't run
yet. Those types are marked with a "$InProcess$" base type, and don't
contain any information on their base type, methods, properties, etc,
and therefore would always fail the heuristic.

Pick-to: 6.11
Task-number: QTBUG-145074
Change-Id: Ic0646ac2b492a3cf0dbbea33d72d62712cf4964e
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't warn in the importer on types where qqmljsimportvisitor didn't run
yet. Those types are marked with a "$InProcess$" base type, and don't
contain any information on their base type, methods, properties, etc,
and therefore would always fail the heuristic.

Pick-to: 6.11
Task-number: QTBUG-145074
Change-Id: Ic0646ac2b492a3cf0dbbea33d72d62712cf4964e
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>qmllint: Add tests for recognizing components within themselves</title>
<updated>2026-03-30T17:26:18+00:00</updated>
<author>
<name>Olivier De Cannière</name>
<email>olivier.decanniere@qt.io</email>
</author>
<published>2026-03-30T11:59:11+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=0a102bea9f45058d10e3799cea7eb4a0da41ad9d'/>
<id>0a102bea9f45058d10e3799cea7eb4a0da41ad9d</id>
<content type='text'>
The base case is fixed. The more complex case is not and is marked by a
QEXPECT_FAIL.

Task-number: QTBUG-117786
Change-Id: I25ca3c6dc57fb4f0e71615a996e1a455fa264dd3
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The base case is fixed. The more complex case is not and is marked by a
QEXPECT_FAIL.

Task-number: QTBUG-117786
Change-Id: I25ca3c6dc57fb4f0e71615a996e1a455fa264dd3
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Compiler: Add support for multiple document edits per fix suggestion</title>
<updated>2026-03-30T11:29:23+00:00</updated>
<author>
<name>Olivier De Cannière</name>
<email>olivier.decanniere@qt.io</email>
</author>
<published>2025-08-21T12:27:38+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=6cfd9cac5ba90f36b61bfad11c7a3d1201f02679'/>
<id>6cfd9cac5ba90f36b61bfad11c7a3d1201f02679</id>
<content type='text'>
The suggested fix to a warning may require multiple document edits
to properly fix the issue.

Imagine an unqualified lookup across a component boundary. One of the
fixes the user should be able to choose from is to qualify the lookup by
adding the id _and_ set 'pragma ComponentBehavior: Bound'. This fix
requires editing the document in two different places.

To this end, FixSuggestion no longer holds a single replacement string
directly but instead holds a list of, newly introduced, DocumentEdit.

Note that FixSuggestion itself still keeps a location as well. This is
intended to point out the location of the warning to the user, which may
differ from the places where the fixes are applied. And, this is also
needed in case we need to warn and suggest a fix but cannot do it
automatically for the user.

The fix suggesting to change 'new Array(1, 2)' into '[1, 2]' was updated
to use the new multiple edits, simplifying the logic.

The output of qmllint was updated to communicate the edits associated
with a fix to the user. The json format was also updated.

The qmllint integration in qmlls was also updated. Testing in creator
shows that multiple edits can be applied correctly for a single fix.

The QQmlSA API was also updated to include a DocumentEdit of its own and
to update FixSuggestion as a consequence. QQmlSA is still in tech
preview.

Change-Id: Ifedb9a50329f0f3e9e59a74981a51e0daab52ae9
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The suggested fix to a warning may require multiple document edits
to properly fix the issue.

Imagine an unqualified lookup across a component boundary. One of the
fixes the user should be able to choose from is to qualify the lookup by
adding the id _and_ set 'pragma ComponentBehavior: Bound'. This fix
requires editing the document in two different places.

To this end, FixSuggestion no longer holds a single replacement string
directly but instead holds a list of, newly introduced, DocumentEdit.

Note that FixSuggestion itself still keeps a location as well. This is
intended to point out the location of the warning to the user, which may
differ from the places where the fixes are applied. And, this is also
needed in case we need to warn and suggest a fix but cannot do it
automatically for the user.

The fix suggesting to change 'new Array(1, 2)' into '[1, 2]' was updated
to use the new multiple edits, simplifying the logic.

The output of qmllint was updated to communicate the edits associated
with a fix to the user. The json format was also updated.

The qmllint integration in qmlls was also updated. Testing in creator
shows that multiple edits can be applied correctly for a single fix.

The QQmlSA API was also updated to include a DocumentEdit of its own and
to update FixSuggestion as a consequence. QQmlSA is still in tech
preview.

Change-Id: Ifedb9a50329f0f3e9e59a74981a51e0daab52ae9
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tst_qmllint: fix weird warning</title>
<updated>2026-03-28T11:52:16+00:00</updated>
<author>
<name>Sami Shalayel</name>
<email>sami.shalayel@qt.io</email>
</author>
<published>2026-03-26T15:10:40+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=e8bf7baea87a227161a9e91031d51f2ad5b68297'/>
<id>e8bf7baea87a227161a9e91031d51f2ad5b68297</id>
<content type='text'>
Add a missing import to avoid a missing type warning.

Pick-to: 6.11
Change-Id: I58476661c27e136f47be401cc354abc8940e7d22
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a missing import to avoid a missing type warning.

Pick-to: 6.11
Change-Id: I58476661c27e136f47be401cc354abc8940e7d22
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>qqmljscontextualtypes: respect precedence when adding types</title>
<updated>2026-03-17T18:27:44+00:00</updated>
<author>
<name>Sami Shalayel</name>
<email>sami.shalayel@qt.io</email>
</author>
<published>2026-03-11T14:18:42+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=49987ee31aed48c204350b38694249eb52e3e933'/>
<id>49987ee31aed48c204350b38694249eb52e3e933</id>
<content type='text'>
The QML runtime uses precedences to import types, types imported via
qmldir's import are less relevant than types with the same name imported
via a QML `import ...` statement, for example.

Mimic the precedence from the runtime in the tooling (but make the
default 1, so that inline components, who should always be considered
first, are 0 and don't need special casing), and increase the precedence
during imports when importing QML module dependencies. Force users of
QQmlJSImporter to specify a precedence, and provide an enum with default
precedence values.

QQmlJS::ContextualTypes only replaces types with the same name if they
have the same or higher precedence, therefore only keeping types in the
QHash that the QML runtime would select at runtime.

Add new ContextualType type that contains the precedence, and inherits
ImportedScope&lt;QQmlJSScope::ConstPtr&gt; to not change all the users
that expect a ImportedScope. Only the QQmlJSImporter needs the
precedence, the other users don't care about the precedence.

Remove ContextualTypes::addTypes(&amp;&amp;) that didn't make use of the
temporary argument anymore, and update the names accordingly to
the preference.

Pick-to: 6.11 6.10 6.8
Fixes: QTBUG-132452
Change-Id: Id83cfdd0b9b293b00c7459cc397e307e91590ded
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The QML runtime uses precedences to import types, types imported via
qmldir's import are less relevant than types with the same name imported
via a QML `import ...` statement, for example.

Mimic the precedence from the runtime in the tooling (but make the
default 1, so that inline components, who should always be considered
first, are 0 and don't need special casing), and increase the precedence
during imports when importing QML module dependencies. Force users of
QQmlJSImporter to specify a precedence, and provide an enum with default
precedence values.

QQmlJS::ContextualTypes only replaces types with the same name if they
have the same or higher precedence, therefore only keeping types in the
QHash that the QML runtime would select at runtime.

Add new ContextualType type that contains the precedence, and inherits
ImportedScope&lt;QQmlJSScope::ConstPtr&gt; to not change all the users
that expect a ImportedScope. Only the QQmlJSImporter needs the
precedence, the other users don't care about the precedence.

Remove ContextualTypes::addTypes(&amp;&amp;) that didn't make use of the
temporary argument anymore, and update the names accordingly to
the preference.

Pick-to: 6.11 6.10 6.8
Fixes: QTBUG-132452
Change-Id: Id83cfdd0b9b293b00c7459cc397e307e91590ded
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>QmlCompiler: Don't warn for ValueTypeBehavior: Assertable</title>
<updated>2026-03-13T21:43:11+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2026-03-12T13:41:50+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=9c8a2dab276a10064bd4ac608b5ba886fc492558'/>
<id>9c8a2dab276a10064bd4ac608b5ba886fc492558</id>
<content type='text'>
We don't use the attribute so far, but we should certainly welcome its
usage.

Pick-to: 6.11 6.10 6.8
Fixes: QTBUG-144585
Change-Id: Iaa69c9401d411a4ad986d4c46ace0bad049b9881
Reviewed-by: Olivier De Cannière &lt;olivier.decanniere@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We don't use the attribute so far, but we should certainly welcome its
usage.

Pick-to: 6.11 6.10 6.8
Fixes: QTBUG-144585
Change-Id: Iaa69c9401d411a4ad986d4c46ace0bad049b9881
Reviewed-by: Olivier De Cannière &lt;olivier.decanniere@qt.io&gt;
</pre>
</div>
</content>
</entry>
</feed>
