Some files in tqtc-qtdeclarative were missing the commercial
SPDX-License-Identifier. Build files, examples, tests, or
documentation are not updated.
Task-number: QTQAINFRA-5900
Change-Id: I2cad9a7a271b0b3f3af3074259614b890b266a91
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 132fe2df41)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since lists are allowed as property types, you should be able to pass
them as arguments to methods, too. For now we only handle QML-defined
methods, implemented by adding JavaScript functions to your QML
elements. The usual type coercion rules apply if you pass JavaScript
arrays to such methods. That is, it usually works.
We now resolve properties with the "list" flag to their actual types
(QQmlListProperty or QList) already when populating the QQmlJSScope, and
store the list types as members of QQmlJSScope rather than as a special
map in QQmlJSTypeResolver. This allows us to do the same to lists passed
as arguments and simplifies some of the type analysis.
Fixes: QTBUG-107171
Change-Id: Idf71ccdc1d59f472c17084a36b5d7879c4d959c0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This is a semantic patch using ClangTidyTransformator to convert
sequences of Q_UNREACHABLE() + return into Q_UNREACHABLE_RETURN(),
newly added to qtbase.
const std::string unr = "unr", val = "val", ret = "ret";
auto makeUnreachableReturn = cat("Q_UNREACHABLE_RETURN(",
ifBound(val, cat(node(val)), cat("")),
")");
auto ignoringSwitchCases = [](auto stmt) {
return anyOf(stmt, switchCase(subStmt(stmt)));
};
makeRule(stmt(ignoringSwitchCases(stmt(isExpandedFromMacro("Q_UNREACHABLE")).bind(unr)),
nextStmt(returnStmt(optionally(hasReturnValue(expr().bind(val)))).bind(ret))),
{changeTo(node(unr), cat(makeUnreachableReturn,
";")), // TODO: why is the ; lost w/o this?
changeTo(node(ret), cat(""))},
cat("use ", makeUnreachableReturn));
a.k.a qt-use-unreachable-return.
subStmt() and nextStmt() are non-standard matchers.
There was one false positive, suppressed it with NOLINTNEXTLINE.
It's not really a false positiive, it's just that Clang sees the world
in one way and if conditonal compilation (#if) differs for other
compilers, Clang doesn't know better. This is an artifact of matching
two consecutive statements.
Change-Id: I3855b2dc8523db1ea860f72ad9818738162495c6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.
Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Apparently we do that somewhere. It should not just crash.
Pick-to: 6.2 6.3
Task-number: QTBUG-102147
Change-Id: Id612e0543d8794aa4f334a899b117142b7a8cd38
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We need to export all the classes used by qmlsc, and we need to use the
private export macro for private symbols.
Change-Id: I91d59611e864621dc2c49b9383596e706529bd42
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Previously the filename was only available for C++ types that have been
exposed via qmltypes. Now every scope has a valid filename to reference.
This is important in order to give more useful hints to the user and
will also prove useful for debugging.
Change-Id: I6142b58278f388814514fffd86cbc241eb969bb2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Introduce a new kind to QQmlJSRegisterContent: "conversion". This is
what we store when we merge multiple types together, or convert a
selection of types into a new one. This way we can record what the
original types were, and later figure out whether we can losslessly
convert them already at the point where we store them.
For now, only merges are implemented.
Change-Id: If4ad0b1f075199e6aa1532959cf9591ba6755709
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The code generator needs to see the modulePrefix as a separate step in
order to generate sensible code. The savedPrefix we had before was not
exposed to the code generator. As an added benefit we can also check
that we don't refer to singletons as properties of objects this way.
Task-number: QTBUG-95822
Change-Id: Ia8992dba340bf0552e7647f0d66b441f1ac1b8c8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Move the type inference code so qmllint can benefit from the improved type analysis.
Change-Id: I00b2fad8334ec19fb33a45b3ceec9d6c49d12e93
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>