Commit Graph

9 Commits

Author SHA1 Message Date
Dmitrii Akshintsev 663ff3cb00 Dom: remove redundant code
This commit removes the following:
- pre and postCode from MethodInfo and ScriptExpression
- setCode from MethodInfo and MutableDomItem
- some other dead code of MutableDomItem

Change-Id: Id5be7626d75c2c469bafd792994c3030c23a5595
Task-number: QTBUG-121518
Task-number: QTBUG-121933
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-09-08 11:30:05 +00:00
Giuseppe D'Angelo fb4abf95c1 Tests: include QTest, not QtTest
Never use module-wide inclusions. They blow up build times. For QtTest
this is usually just a typo (QTest was meant instead). Add missing
includes as needed.
In the diffs I've spotted other huge inclusions (QtQuick, QtQml), but
those need more attention.

Task-number: QTQAINFRA-7110
Pick-to: 6.9 6.8
Change-Id: I74bf3fe212f50a7a3a6af2b1c80bbcaabc2516d7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2025-04-15 19:27:07 +02:00
Dmitrii Akshintsev b666cda75c Reflect some old refactoring changes in qmldomloadeditwrite
After some the of DOM refactorings, this file apparently was left out.
Fixing this now

Change-Id: Ic1b9d147518e50d8b16be88a55ff2417c558a910
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-07-03 16:36:49 +02:00
Lucie Gérard 9c5fc88388 Correct license for test files
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>
2024-02-27 10:32:21 +01:00
Dmitrii Akshintsev 37ef144704 DOM refactoring. Remove LoadOptions
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>
2024-01-30 17:14:09 +01:00
Dmitrii Akshintsev 751d3441a5 DOM Refactoring. Move loadbuiltins from DomItem to DomEnvironment
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 built-ins to the DomEnvironment.

Task-number: QTBUG-119550
Change-Id: Ibad35d9f716e0a38bf560a3bfa87070655b55a94
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-19 23:18:53 +01:00
Dmitrii Akshintsev 3805424abc DOM refactoring. Move loadPendingDependencies to DomEnvironment
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>
2024-01-18 18:46:18 +01:00
Dmitrii Akshintsev bb4391a93e DOM refactoring. Remove DomItem::loadItem. enable_shared_from_this for DomEnv*
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>
2024-01-18 11:12:30 +01:00
Sami Shalayel 5dda854129 qmldom example: move to manual tests
You cannot use the qmldom example without private API, so it is not
really suitable as a public example. Move it to manual tests.

Change-Id: I365b32c1ba1bf4414e439f16ab7df7ae5643d20f
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-24 18:34:03 +01:00