Now developer build tests compile, but some are not working.
Functional fix will come later via separate tasks.
Task-number: QTBUG-122999
Change-Id: I0a0dfcf7affb73f928b8be62b3576a6a51658488
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Currently, a DomEnvironment could load QML files with different
DomCreationOptions. This makes things more complicated when loading
dependencies, for example the implicit directory import might load a
qmldir file that imports another module that contains a certain QML
file, and then one has to remember which file triggered all of this
dependency loading and what DomCreationOptions it had.
In addition, there is currently no use case for something that
complicated.
Instead of that, move the DomCreationOptions to the DomEnvironment
itself. When a DomEnvironment is used to load a file and its
dependencies, it will use the DomCreationOptions set on this
DomEnvironment.
This ensures that all dependencies are loaded with the correct
DomCreationOptions, and avoids weird bugs in qmlls features due to
wrong DomCreationOptions used for dependencies.
Remove the DomCreationOptions from the FileToLoad struct, adapt the
DomEnvironment constructor and static factory method to expect a
DomCreationOptions parameter, and change all DomUniverse::load()
methods to have an extra DomCreationOptions parameter.
This commit will break the formatting tests so QSKIP them, at least
until the lazy-loading is done. The reason for the breakage is that the
Dom eagerly loads all QML files from imports, and that takes too much
time or crashes because it loads them now with the correct
DomCreationOptions instead of DomCreationOption::None.
For example, the formatting tests will implicitly load
nestedFunctions.qml via the implicit directory import with the
DomCreationOption::WithScriptExpressions and that will crash because
of the nested functions, see also QTBUG-122707.
Therefore QSKIP the formatting tests.
Also adapt the timeout for a test that imports QtQuick.Controls.Basic,
as the Dom also eagerly loads all the QML files from an imported module,
which takes much more time with the
DomCreationOption::WithScriptExpressions.
Task-number: QTBUG-122645
Change-Id: Icb7eb6d17df15fc6ea133e014c00153df5cd1492
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only
[1]: https://contribute.qt-project.org/quips/18
Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I26d72e8de04d4c7c57b3b7838af5d033265de5ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Only defaultLoad is being used, hence it doesn't make sense to have them
at all at the current stage
Task-number: QTBUG-119550
Change-Id: I761e7c55d6aaafa29d234ace4b4b65bcc46a9855
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
One of the goals of this refactoring is to move DomTop specific
functionality from DomItem API to the corresponding DomEnvironment
and DomUniverse.
This commit moves loading of the dependencies (which are added to
the pending load queue implicitly as part of the callbacks of the
loadFile when DomEnv is created without the flag "NoDependencies") to
the DomEnvironment interface
Moreover, once work with dependencies is happening through the
DomEnvironment explicitly, it allows us to get rid of "self"
parameter.
Task-number: QTBUG-119550
Change-Id: Ib3deb97eabe091ffded8c8c782ee08f8024468f2
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
As it was mentioned in the previous commits in the chain one of the
goals of the refactoring is to introduce clearer separation of
concerns.
Only DomTop types are allowed to load files, hence it's arguable
should be reflected in the interfaces explicitly.
With the help of previous commits the relevant pieces of this
function were moved to the corresponding DomEnvironment and DomUniverse
types.
This commit finally removes loadFile from the DomItem API.
*It's also worth noting that in order to minimaze refactoring
efforts and to keep the public API simple (not requiring
DomItem &self argument on the top level), this commit also makes
DomEnvironment a child of the std::enable_shared_from_this.
This somewhat "breaks" the initial design approach inscribed
in the DOM API allowing DomEnvironemt to get a shared_ptr to itself
bypassing corresponding DomItem.ownerAs<> API.
However, in the tradeoff of preserving consistency of the previous
design and the explicitness of the interface, I would value the latter,
hence I find this change acceptable.
Change-Id: Ic2ce3fc80876be6bdbec93e4d273e4c6b7a2b218
Task-number: QTBUG-119550
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We almost never want non-const DomItems anywhere. There is exactly one
exception: From a MutableDomItem we need to poke into the internals of
the respective DomItem and const_cast them. However, MutableDomItem is
to be handled with care anyway.
Change-Id: I826f0669c049462beec9ad71dccb39c5191a1d3f
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
It takes considerable time to finish as auto test, slowing down the
development speed. It should live in benchmarks.
Change-Id: I4cb6f7712774a6d36e000dec713db67019d84f6e
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
There was a typo in the auto test's target name, but fixing it also
requires renaming the benchmark which has the same name.
Pick-to: 6.2 6.4
Change-Id: I8e7b6de472ed84df0917584592f28d7015618331
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to
handle typedefs and accesses through pointers, too:
const std::string o = "object";
auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); };
auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) {
auto exprOfDeclaredType = [&](auto decl) {
return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o);
};
return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))));
};
auto renameMethod = [&] (ArrayRef<StringRef> classes,
StringRef from, StringRef to) {
return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)),
callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))),
changeTo(cat(access(o, cat(to)), "()")),
cat("use '", to, "' instead of '", from, "'"));
};
renameMethod(<classes>, "count", "size");
renameMethod(<classes>, "length", "size");
except that on() was replaced with a matcher that doesn't ignoreParens().
a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'.
Change-Id: I58e1b41b91c34d2e860dbb5847b3752edbfc6fc9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:
auto QtContainerClass = anyOf(
expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
makeRule(cxxMemberCallExpr(on(QtContainerClass),
callee(cxxMethodDecl(hasAnyName({"count", "length"),
parameterCountIs(0))))),
changeTo(cat(access(o, cat("size"), "()"))),
cat("use 'size()' instead of 'count()/length()'"))
a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.
Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
For several reasons:
* It was renamed to QT_DISABLE_DEPRECATED_UP_TO
* Its value will be propagated from the general Qt build
Task-number: QTBUG-104858
Change-Id: I90c92dc05b884f6408467c573181c00f8e00e6b3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.
Existing copyright statements remain intact
Task-number: QTBUG-88621
Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@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>
Test at many moments from spring 1967 (before the epoch) to summer
2046 (after 32-bit time_t's sign-wrap).
Change-Id: I3932cc1553a868b8815fda9a8dfc7644e4485704
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Inline the trivial constructor.
Get rid of the pointless destructor.
Use QDirIterator instead of QDir, to save collecting a bunch of
strings, only to iterate them, when we could simply iterate them.
Use QDirIterator::filePath() instead of adding fragments ourselves.
Use u"*.qml"_qs instead of constructing QString from ASCII.
Use QString::chopped(4) rather than left(size() - 4).
Use QScopedPointer to ensure tidy-up of allocated object.
Don't use 0 as a null pointer value.
Waste less vertical space.
Change-Id: I44f62f4e41f63de860f47114b2f47dddbf9746bc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The .pro files corresponding to the .prev_CMakeLists.txt files
have already been removed.
Change-Id: I254eafe4c7de1a516e33bd9cb3d9879e73fa83b4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Remove all qmake project files, except for examples which are used to
test that qmake continues to work.
Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Modify special case locations to use the new API as well.
Task-number: QTBUG-86815
Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
[ChangeLog][QML][QQmlListProperty] Removed deprecated QQmlListProperty
constructor taking a reference. Use the overload taking a pointer
instead.
Change-Id: I8942026d1bb1c88065659d96d648a4b256d7d427
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This is required to remove the ; from the macro with Qt 6.
Task-number: QTBUG-82978
Change-Id: Iead53d18fd790fb2d870d80ef2db79666f0d2392
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
In many places we carry major and minor versions or revisions that are
loosely coupled to minor versions. As the Qt minor version resets now,
we need to handle these things more systematically. In particular, we
need to add a "major" part to revisions.
QTypeRevision can express the current major/minor pairs more efficiently
and can also be used to add a major version to revisions. This change
does not change the semantics, yet, but only replaces the types.
Change-Id: Ie58ba8114d7e4c6427f0f28716deee71995c0d24
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>