aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmldom
Commit message (Collapse)AuthorAgeFilesLines
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-3/+3
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I601bf70f020f511019ed28731ba53b14b765dbf0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-09-071-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: Id89ed14990804a5024183e75382cc539d4293da1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for executablesAlexandru Croitor2022-07-211-1/+1
| | | | | Change-Id: I346ea4eac1dfbfb7fb81609307f5f7c4716bb8d1 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* qmldom: add support to dump a QML file's syntax treeMoody Liu2022-07-081-1/+24
| | | | | | | | | | with the help of existing QmlAstDumper, this will help develop various utilities for qml files, such as qmlls [ChangeLog][QML][qmldom] Add support to dump AST of a QML file Change-Id: Ia5a6023724a41361279414887e0d82f398b1c773 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* Add license headers to cmake filesLucie Gérard2022-07-081-0/+3
| | | | | | | | | | | | 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>
* Use SPDX license identifiersLucie Gérard2022-06-111-27/+2
| | | | | | | | | | | | 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>
* Skip unnecessary commands when cross-building toolsJoerg Bornemann2021-10-081-0/+1
| | | | | | | | | | Call qt_internal_return_unless_building_tools() directly after qt_internal_add_tool() to avoid having to special-case code for when this function only creates imported targets in cross-builds. Task-number: QTBUG-85084 Change-Id: I5c8f2ecdf4936cfd15cb530e896bc4e5b5531620 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove obsolete bootstrap codeFabian Kosmale2021-09-301-7/+1
| | | | | Change-Id: Ifcbf81b5ee04753af916dc1ef1177617785c961d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmldom: improve qmldom tool dumpFawzi Mohamed2021-09-101-51/+79
| | | | | | | | | | | | | | | Make the default dump more concise and useful: * remove most large fields non related to the semantics (comments, file location, exports, pre/postCode,...) * allow empty (catch all) filter * call filter.setFiltred() to correctly filter custom filters * dump the loaded files, and not the whole environment (unless requested with --path-to-dump $env) * do not load dependencies by default Change-Id: I5d26dc074bc0cbace31508401e9d08d90c99a254 Pick-to: 6.2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmldom: cleanup, avoid redundant namespace specificationFawzi Mohamed2021-09-091-6/+4
| | | | | Change-Id: I14dc9a51805ea21ae91734d12821a5a3e4849e10 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmldom: pass optional fileType to loadFileFawzi Mohamed2021-09-061-14/+18
| | | | | | | | | | | | | If filetype is given use it to specify the type of the file to load (otherwise guess it from the file extension). Can be used to load qmltypes files as "plain" qml files (for reformatting). Ths enables the reformatting of .qmltypes (for API comparison) Change-Id: Ib65647c2a8dc8b37b7e955acb3aec2193d36666d Pick-to: 6.2 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmldom: support qmltypesFawzi Mohamed2021-08-271-0/+25
| | | | | | | | read qmltypes files using the QmlCompiler provided reader Change-Id: Ifb091a1d645e697cd3b648da96c69868f240d037 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* replace devtools library with QtQmlFawzi Mohamed2021-07-021-1/+0
| | | | | | | | | | | | | | | qmldevtools was needed when building with qmake, and to avoid circular dependencies in the tools (before making QtQml minimal). Now it can be avoided. This change will make qmldom, qmlformat, qmlimportscanner and qmllint depend on QtQml (just like the other Qml tools) and not be always completely static (qmldevtools was always a static library, QtQml normally isn't). Change-Id: Idfa0a70e51f0d4999fb9753121c6c228ae69c9bb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* qmldom: writeOut, write reformatted QmlFawzi Mohamed2021-06-051-1/+50
| | | | | | | | | | | | Adding writeOut: support for reformatted Qml - linewriter: write line by line with caching, callbacks, SourceLoaction updating - outwriter: write to line writer, and keep track of updated file locations and reformatted ScriptExpressions - reformatter: reformat javascript Change-Id: I4bdc393fb2d9b5a3db944a850719c24ef8726d15 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmldom: compare and dump to file, domtoolFawzi Mohamed2021-06-052-0/+243
* qqmldomfieldfilter: ignore fields or types in dump or comparison * qqmldomcompare: compare DomItem * qqmldomfilewriter: safely write to a file (keep backups, avoid overwrite before success is confirmed, avoid overwrite if equal) * qmldomtool: command line tool to dump dom Change-Id: If4fbff7dff70d3a780293ac8b458f674e8f91591 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>