aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* qmltyperegistrar: Store foreign metaObjectHash for QML_FOREIGN typesOlivier De Cannière5 days1-0/+1
| | | | | | | | Amends b0bf54bdb02863bce25764c6e1efc42a03071ef2 Task-number: QTBUG-142186 Change-Id: I0b2b9bf282e374f3f374cda32c0e2096aa0bb14a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmllint: warn on shadowed properties/signals/methodsSami Shalayel2025-11-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Warn when shadowing properties/signals/methods in qmllint. Move the already existing duplicate property check into its own static method warnForDuplicates, and extend it to check whether base types also have a property of the same name. Use it when analysing definitions of methods, signals and properties in qmljsimportvisitor to warn about shadowed properties. As a drive-by change, fix the sourcelocation of the duplicated property warning to point to the name of the property/signal/method instead of the "property" or "function" keyword. To avoid adding more testcases to the already big tst_qmllint::dirtyQmlSnippets_data(), create a new tst_qmllint::shadow_data() method for the shadow related tests, and make tst_qmllint::shadow() call dirtyQmlSnippet(). This allows to reuse the test code from dirtyQmlSnippet without making dirtyQmlSnippets_data grow even more. Adapt some existing test-cases by adding qmllint disable directives where shadowing was wanted, and disable the shadow category on tst_qqmljsscope (which does not make use of the qmllint code that reads qmllint disable directives), as it seems that tst_qqmljsscope tests that shadowing works as expected (shadowing is a feature, after all...). I guess this patch might need to be updated in the future once we have override and virtual properties in QML via QTBUG-98320. Make the qmlShadow warning non-critical for qmltc, as qmltc supports shadowing, to avoid breaking the qmltc tests. Task-number: QTBUG-141854 Change-Id: I74c1b413e2c19a0db34215b34a9b65d43fbef6ce Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* Avoid "replacing existing signature" message when signing qmltestrunnerTor Arne Vestbø2025-11-261-1/+4
| | | | | | | | Instead of forcing a re-sign, we remove the signature first, which makes the operation silent in the success case. Change-Id: Ic312eacfd87a6eb5795a6bd1fe841b9c37d8359d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QmlDebug: Support QtQuick3D profiler eventsUlf Hermann2025-11-101-1/+2
| | | | | | | | | | | | The client definitions should provide the same event types as the service definitions. Adapt the code for reading and writing the events from Qt Creator. Change-Id: Ib714304a5b56f7d1bd9c1f53656554b9705f630b Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* qmllint: Fix formatting for --list-plugins optionsOlivier De Cannière2025-11-071-3/+22
| | | | | | | | | | | | | | | The plugins details can extend outside of their respective column if they are too wide. This also offsets the remaining columns on that line, breaking the formatting of the table. Instead of simply allocating a fixed space for each element, compute the required width of each column and use it to format the table. Amends 7c9276d38b311042235a476e7421b64549b43413 Pick-to: 6.10 6.8 6.5 Change-Id: I67a5484eda38cc96bb5c66ba7283b87c7f1bb3a1 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Compiler: Rename QMLLINT_DEFAULT_CATEGORIES to BUILTIN in stead DEFAULTOlivier De Cannière2025-11-051-1/+1
| | | | | | | This helps avoid confusion with the default field for categories. Change-Id: Iceb9a2adeb928a0f801fab9c718a8ecc3ac8cd07 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* qmllint: Remove the unused m_isBuilin flag from qmllint PluginsOlivier De Cannière2025-11-051-4/+3
| | | | | Change-Id: If477518595f6c625101209b12e908e7e18a3b5c4 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* qmlformat: Add argument to output available optionsXavier BESSON2025-10-301-0/+3
| | | | | | Task-number: QTCREATORBUG-33305 Change-Id: I9e23a755da0354ab1d64b7f50ff6f9cc7acbe85a Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* qmllint: Remove redundant call to updateLogLevelsOlivier De Cannière2025-10-301-7/+1
| | | | | | | | It gets called again for every file anyway and may actually cause issues by overriding previous changes made to categories. Change-Id: I9ed4444f2bf2012a19dfdacd7fe0798faa5942f6 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QQmlSettings: Warn user about unrecognized sections in tooling ini filesOlivier De Cannière2025-10-301-3/+7
| | | | | | | | This can help users identify typos in section names such as [Warning] -> [Warnings]. Change-Id: I6984c3b5f3f06b8a393f83b951f47b05b5565efd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmllint: load different import paths from setting file correctlySami Shalayel2025-10-241-11/+3
| | | | | | | | | | | | | | Use the same logic as qmlls to load import paths in qmllint: QVariant::toStringList() always returns a QStringList() of length one. Instead, use the QDir::listSeparator() char to split the list into multiple one, allowing the users to pass multiple paths via settings files. Somehow the setting file entries to pass paths to qmllint are not documented, so no need to update the documentation it seems. Pick-to: 6.10 Task-number: QTBUG-141385 Change-Id: Iaf34c09601bfb423ceb658e9a87a961b5d8c1c90 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix svgtoqml invocation when there is no windowing systemEskil Abrahamsen Blomfeldt2025-10-161-12/+16
| | | | | | | | | | | | | | | | | | | | | | | Amends 641883c7e19b618ee47f0f7988bb161dc1056ae2. This change fixed an issue when cross-compiling and a platform plugin is not available. It selects the offscreen plugin when this case is detected, but uses the default platform plugin otherwise, since the offscreen plugin has limited support for fonts so we do not want it as the default. However, this did not fix the case where the platform plugin exists but there is no windowing system, e.g. when building over SSH. Luckily, the minimal QPA plugin does have proper font support and also works over SSH. We can therefore use this as the default as long as it exists. The only exception is if we need GUI to preview the result (if -v is specified or if there is no output file.) Task-number: QTBUG-140675 Change-Id: I967c8649be070c7ffc6541d033603c8e0e5c6eae Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QmlDebug: Move QmlProfilerData to the QmlDebug libraryUlf Hermann2025-10-157-739/+16
| | | | | | | | | | | We want the default XML format for profiling data to be available to all debug clients since we will need it in other places. This also clarifies the interface of the event receiver and opens the path to having another implementation that produces the .qzt format. Change-Id: I4b0cd263a85996f61f2d3d14bdda616bd44e95b2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* qmltc: Fix context assignmentUlf Hermann2025-10-101-4/+14
| | | | | | | | | | | | | | If an object is not the document root we need to set the document root's context as its outer context, so that IDs end up in the right place. However, when calling a method on an object, we need to provide the context the method was declared in, not the context the object was instantiated in. Otherwise we get the wrong set of IDs. Pick-to: 6.10 Fixes: QTBUG-139142 Change-Id: Iaeba89c44c955ed09a9778e5d6cc4150e86793ba Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
* qmlformat: expand OutWriter's constructorSemih Yavuz2025-10-011-18/+1
| | | | | | | | | | | | | | | | code and comment location information is needed by OutWriter to scan format directives. Allow these to be created at OutWriters' construction. Get this informations through ExternalOwningItem interface. Unfortunately, ExternalOwningItem interface won't provide comment() or engine(). Use derived types to get that information for JSFile and QmlFile. Task-number: QTBUG-97796 Change-Id: I57ef2a3a52579dd5698219a6e6ac9449c113d080 Reviewed-by: Dmitrii Akshintsev <dmitrii.akshintsev@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* qmlformat: Disable WriteOutCheck at runtimeSemih Yavuz2025-10-011-6/+2
| | | | | | | | | | | - WriteOutCheck is now set to None for runtime usage, simplifying logic and avoiding complex DOM comparisons and exceptions. It is already disabled for several cases. - The check remains available for test purposes. Task-number: QTBUG-97796 Change-Id: I259511f84cf8a71f46fc3df698cb9a8a462dc559 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QmlCompiler: Properly handle uncertain component statusUlf Hermann2025-09-181-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to determine whether an ID is visible from a referrer we need not only determine the component boundaries of the referrer, but also those of the candidate elements with the respective ID. Rewrite the logic to have QQmlJSScopesById handle this. It has to iterate the respective elements anyway and can therefore easily check if one of them is assigned to an unknown property. It now provides low-level methods that output all possible candidates for an ID, while also stating the confidence associated with them. The plain id() and scope() methods only return results we are actually certain about. In places where we generate warnings or can allow for some fuzzy results, we use the low-level methods, since those generally produce more informative results. The QML DOM was passing the JavaScript global object as referrer to the scope() method before. This happened to work but was, of course, wrong. Make sure that ID elements in the DOM receive a proper QML scope to avoid that. Pick-to: 6.10 6.9 6.8 Task-number: QTBUG-140041 Change-Id: I41cf8603ae6a5d5461d3c12d74521e68b5e28ea4 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* Add security header for src/qmlformatSemih Yavuz2025-09-171-0/+1
| | | | | | | | | | | There is no security critic code in qmlformat. Everything remains at the default "signicant" security level. QUIP: 23 Fixes: QTBUG-136198 Pick-to: 6.10 6.9 6.8 Change-Id: Iac1c84748bc98a9c921fc8ae895a2dcd53d01270 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* svgtoqml: Don't output full file path in commentEskil Abrahamsen Blomfeldt2025-09-111-1/+3
| | | | | | | | | | | | | | As part of the comment generated by svgtoqml, we would include the entire file path as it was provided in the arguments. With the introduction of the automatic svgtoqml build step, this argument will now include the full absolute path. Since the QML file is embedded in the binary, this caused internal file paths from our build farm to leak into the binaries, triggering an alert in the QA system. Change-Id: Iecffb5cfcf1cee127186b2c5d2e21e2ccc47f48a Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
* Make svgtoqml run correctly even without default platform pluginEskil Abrahamsen Blomfeldt2025-09-111-10/+11
| | | | | | | | | | | | | | | The Qt SVG parser depends on having a QGuiApplication in order to load e.g. fonts. We want to prefer the default plugin on desktop platforms, since you will then be able to use SVGs that depend on system fonts as well. However, in a host build, where there are no GUI-enabled QPA plugins, we fall back to offscreen, which has some font support but which does not depend on a window manager. Task-number: QTBUG-139976 Change-Id: Ia9a5239c3d16f1daa4ad68d66412f519109361c2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QmlCompiler: Rename sequences' "valueType" to "elementType"Ulf Hermann2025-08-314-13/+13
| | | | | | | | | "valueType" is ambiguous. The prevailing meaning is a type that's passed by value in QML. We mean the type of the list contents (or elements) here. Change-Id: Iaf4c0efe272dc6ec7511d2361e7e5ce475936fba Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* qmllint: don't search for heuristic context propertiesSami Shalayel2025-08-251-3/+1
| | | | | | | | | | Don't search for heuristic context properties in qmllint, to avoid making qmllint more complicated from a user perspective. Instead, qmlcontextpropertydump can be used via its CMake target. Task-number: QTBUG-128232 Change-Id: Ie7553821e6b62c0a89179e8abee2ac7d15647265 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Fix execution of svgtoqml toolAlexandru Croitor2025-08-251-1/+5
| | | | | | | | | | | | | | | | | | It fails in a no-prefix per-repo build of qtdeclarative standalone examples build, with the following error: ninja: error: 'examples/quick/quickshapes/weatherforecast/Qt6::svgtoqml', needed by 'examples/quick/quickshapes/weatherforecast/.qt/svgtoqml/Europe_generated.qml', missing and no known rule to make it Wrap the command in a <TARGET_FILE> genex, and prepend the tool wrapper shell script for Windows hosts. Amends 018b10ff710e75841b02e052f8d851723f555b7b Change-Id: Ib4aa91f3680cad40ac462a48b09a4acf795ff7ae Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* qmlcontextpropertydump: add tool for context property searchSami Shalayel2025-08-223-0/+63
| | | | | | | | | | | Add a tool that runs the heuristic for context properties and dumps the .ini generated by the heuristic search, for future calls of qmllint. Add a test. Task-number: QTBUG-128232 Change-Id: I5d03db45f41ef90c6f5d931837aaa466abc33303 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmllint: Update JSON format to include hints into fix suggestionsOlivier De Cannière2025-08-201-1/+1
| | | | | | | | | | | | | Hints are no longer their own fix suggestion but instead are part of an existing one. This breaks compatibility with the existing format but as the output is not documented and is versioned this should be ok. This change will enable having multiple fix suggestions per warning in a future change. Pick-to: 6.10 Change-Id: Iedf275507554a2d70399757396e278999874cd53 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmltoolings add --dry-run option for qmlformat and qmllintSemih Yavuz2025-08-142-1/+10
| | | | | | | | | | | | | Add reportConfigForFiles to generic tooling class. It will perform the search for the given files. Use stdout to report. qmllint had already an option --dry-run for printing the fixed codes, but we can still allow this to use that option name. For qmlls, report the path if verbose option is set. Fixes: QTBUG-137874 Change-Id: I6bd43866073b3df832b6fd89d477bced869d74c0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qt_target_qml_from_svg() command in cmakeEskil Abrahamsen Blomfeldt2025-08-142-0/+97
| | | | | | | | | | | | | This adds a build command for generating QML files out of SVG files automatically. It works by first calling svgtoqml on the sources and then adding these to the QML module for the target. [ChangeLog][svgtoqml] Added a cmake api for automatically generating QML files from SVG files in an application. Task-number: QTBUG-128915 Change-Id: I44e70f0ada4ca8ac9ac8253d46832d3a286da927 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qmllint: make contextproperties a real class and renameSami Shalayel2025-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Prepares for QTBUG-138061 where we need a way to load user-defined context properties into QQmlJS::ContextProperties. Rename QQmlJS::ContextProperties into HeuristicContextProperties to avoid confusions with the UserContextProperties. Make HeuristicContextProperties a real class so that we can add methods to load and save context properties to and from disk. Make the heuristics be saved in a list instead of a QHash, as the order of the property matters as we write them out into a file and testing becomes complicated when the order changes between different runs. Also note that it might be confusing for qmlls users if their warnings change orders during multiple runs. Rename some methods for clarity. Task-number: QTBUG-138061 Task-number: QTBUG-128232 Change-Id: Ib6302f609e182e622015293366c8b42425566a0e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltc: Don't crash on missing type informationUlf Hermann2025-08-052-6/+17
| | | | | | | | | Pick-to: 6.10 6.9 6.8 Fixes: QTBUG-136355 Change-Id: I0cf56674b451187a3483f4dfefbf6e1ccb275d04 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Semih Yavuz <semih.yavuz@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Expose XMLHttpRequest to qmltypesFabian Kosmale2025-07-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QML, one can use XMLHttpRequest. Not so with a plain JS engine. The reason for that lies in the fact that a JS engine did not have any network access, because all network functionality was in the type loader, and the type loader was coupled to the QV4::Engine. This has changed in d2bc4a4330254c0c68a0ade51b59a71c4b67b470, but we stil don't expose XMLHttpRequest to a plain QJSEngine. Nevertheless, it conceptually lives in the global object, and we need to collect information about it to enable code completion and linting. Consequently, expose a function in QV4::Engine, which allows us to manually trigger the registration, and call it in qmljsrootgen. Going forward, we should arguably have a QJSEngine::Extension for XMLHttpReuqest, after which we could remove the hack. Note that as before, qmljsrootgen prints a few warnings, because we call functions in contexts in which they must not be called. As before, we ignore this for now. As a side-effect, this adds a few more entries to the qmltypes file for new entries on the global Qt object. Task-number: QTBUG-137075 Pick-to: 6.10 Change-Id: I21e9d62bf075e8d4356db8f357502feb927717e7 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* qmlimportscanner: Optionally add version to output againFabian Kosmale2025-07-081-1/+5
| | | | | | | | | | | | | | | | | | | This is not needed by our own tooling, and in the case of major version only imports might lead to funny results. It is however used by Linux distro tooling, and can't cause issuse with older QML projects that never used the more advanced import features. The feature is only enabled when the add-version flag is passed, as we don't want to risk confusing our own tooling which might not expect the value to exist. Amends 6aa4c83bdbd9a8df05c14ac1aaad2f1d44053ec4 Note that we need to adjust the rootPath.json file, as the new file causes us to find more modules. Pick-to: 6.10 Fixes: QTBUG-115170 Change-Id: I20d39dacc87f18fc5bbec93aaec5bdaef0c77c4b Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Adjust to QUnifiedTimer slow mode changesMitch Curtis2025-06-272-2/+2
| | | | | | | | | a318e331f1387eb3c9d13be96c28619453a35571 in qtbase. Task-number: QTBUG-137919 Change-Id: I98e3871053bbb04b83aa114844f07293501d95d6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQml: Don't use loadModule in qmljsUlf Hermann2025-06-181-22/+33
| | | | | | | | We need to get rid of it. Use the type loader instead. Change-Id: I63be8eab38401feed4e6461b03804e8335f41899 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* CMake: Force-build qmltestrunner when cross-compilingAlexandru Croitor2025-06-171-17/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qmltestrunner binary needs to be available as a CMake target, so that a $<TARGET_FILE:...> genex can work. KDE projects use such a genex to run their qml tests. For Windows on ARM, when it is cross-compiled from an x86 Windows host, we need the binary to match the target platform and arch, to be able to run the tests. To achieve both use cases, change the binary back from an app to a tool to make it available as a target automatically when calling find_package(Qt6Qml). To ensure the binary is also cross-built for the target arch when cross-compiling, set QT_WILL_BUILD_TOOLS and QT_WILL_RENAME_TOOL_TARGETS to ON locally in the subdirectory. Add an opt out not to build the target binary (by skipping the local QT_WILL_BUILD_TOOLS assignment) if QT_NO_TARGET_QMLTESTRUNNER is set. This won't affect regular yocto builds that set QT_FORCE_BUILD_TOOLS to ON, so that will work as usual. This is a temporary workaround, until we can create some kind of QtFooAppsConfig.cmake file which would expose the binary as an app target, rather than a tool target, like we currently do for tools. Amends 722116b32a5c18dde24d15232edfbecf605a240a Pick-to: 6.10 Task-number: COIN-1211 Fixes: QTBUG-137005 Change-Id: I9b5a59f5bd30c2e30e5578354515e018383f2926 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QtQml: Hold QQmlTypeLoader in QV4::ExecutionEngineUlf Hermann2025-06-171-19/+20
| | | | | | | | | | | ... rather than QQmlEngine. This paves the way for having the type loader attached to ExecutionEngine rather than QQmlEngine. Also, reference the execution engine in the type loader, in turn. Task-number: QTBUG-19407 Change-Id: I04e571c5c6ac5bce5e82537cb96c6940c7186f3a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Better encapsulate QV4::ScriptUlf Hermann2025-06-051-2/+2
| | | | | | | Make members private, add accessors, add m_ to member names, etc. Change-Id: I497db10b62bbfb32f55dca227af9a518da6eaa70 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Add assumeTrustedSource property to VectorImageEskil Abrahamsen Blomfeldt2025-05-301-0/+7
| | | | | | | | | Certain checks and restrictions are in effect by default on the SVG parser. This introduces a way for disabling these in the VectorImage, when it is used with trusted content. Change-Id: I7a11c7276a01ae9eb128ed0afb2a04c38fe90c7a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QQmlJSLinter: add crude context properties warningsSami Shalayel2025-05-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | Warn in QQmlJSTypePropagator::generate_LoadQmlContextPropertyLookup() about usages of context properties that were found. Also treat context properties as var. Add the (C++) location of the "setContextProperty()" call to the warning, and also hint that a property is assumed to be a context property when inside a top-level component (capital C Component, inline component or implicitly wrapped as component) because it is not declared as required property. Still print the accompanying unqualified warnings next to the new context property warning. Add a test. Later patches will add the support to qmlls and qmllint by passing the workspace folders to the new functionality. Task-number: QTBUG-128232 Change-Id: I26e39e0bce8c6e9f203962a091209c7acd15d445 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* Improve builds for non-threaded qtTim Blechmann2025-05-201-25/+23
| | | | | | | | | | A top-level configuration with FEATURE_thread=OFF fails when autotests are enabled. Most tools can be built without threads nowadays, so we enable them and only exclude the qquickworkerscript and gifs tests. Pick-to: 6.8 6.9 Change-Id: I809b021b4bdc4031d6c3335bea3aee414f5ce863 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Build qmltestrunner with target archMichal Klocek2025-05-121-8/+7
| | | | | | | | | | | Change arch build type of qmltestrunner to match the target and not host. This amends 3e2a85384b1f5454e51a27827114e49746f8837a. Task-number: COIN-1211 Change-Id: I4cac9d0d664ea14bd95cea10936d790ab1d33d4a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qml-tool: Treat all arguments passed after "--" as positionalOlivier De Cannière2025-04-231-0/+3
| | | | | | | | | | | The argument "-a" passed after "--" was being interpreted as the -a option of the qml tool itself instead of being passed along to the qml program as a positional argument. Fixes: QTBUG-136120 Pick-to: 6.9 6.8 6.5 Change-Id: I602aea84e4766abeb47adce0f739f12315a70b24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlls: add --version command line parameterSami Shalayel2025-04-231-0/+5
| | | | | | | | | | Add a command line parameter to print the qmlls version, required by qmlls clients to check the version of downloaded qmlls binaries. Fixes: QTBUG-132692 Change-Id: I7903f6859b6da2f3849a899e46fe4c5ce1cf4c42 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltc: Cleanly reject custom parsed propertiesUlf Hermann2025-04-153-1/+19
| | | | | | | | | | | | Process all properties of custom parsed types and generate errors if the custom parsed properties are actually used. Then print an extra error stating that qmltc does not support custom parsers. Pick-to: 6.9 6.8 Fixes: QTBUG-134206 Change-Id: I37e4f3f8d0ee4e0926c0d64c99a4a521b093a1ab Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* Port away from QPairZhao Yuhang2025-04-124-12/+12
| | | | | | | | QPair is just an alias of std::pair anyway. Task-number: QTBUG-115841 Change-Id: I26fc90adcc775aac9955ad57304af914dc4ed48f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmltc: Properly escape translation stringsUlf Hermann2025-04-111-15/+17
| | | | | | | | | We have QQmlJSUtils::toLiteral() for that. Extend it to handle byte arrays in addition to strings and use it. Fixes: QTBUG-134726 Change-Id: Ibde1f56b25794fc8c49b796303c4f39933aedb42 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* QtQml: Dissolve qqmltranslation.cppUlf Hermann2025-04-111-1/+40
| | | | | | | | | We don't want to export those symbols from QtQml. Move the code that's exclusive to the debug service into the debug service and the code exclusive to qmltc into qmltc. The remaining code can be inline. Change-Id: Icf146af8d4e5931b7ac7bac61a5ba94449ca9402 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Implement item generator via QML generatorEskil Abrahamsen Blomfeldt2025-04-111-1/+1
| | | | | | | | | | | | | | | | | We were spending time doing the same implementation twice, since the item generator and QML generator were two separate code paths. We also risked having bugs which only occurred in one of the code paths. This may at some point be a valid optimization, but during development it is premature. The parsing of the QML is a one-time cost when loading the SVG and this is an acceptable cost for now. Optimizations can come later when we have a more stable state. Fixes: QTBUG-135269 Change-Id: I649a89d7a2e18ef1c0213658dc106f2cc1194841 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* CMake: Force override while code signing qmltestrunnerAlexandru Croitor2025-04-101-1/+1
| | | | | | | | | | | | | | | | Some clang toolchains use implicit adhoc codesigning when compiling and linking executables. This causes an error for the qmltestrunner codesign call, saying that the executable is already signed. Force the codesign command to override the existing signature in that case. This is safe, because we build the executable from scratch. Amends 1f7b87cd3d0dff022b3c072016c6257cc5d9e93a Pick-to: 6.8 6.9 Fixes: QTBUG-135279 Change-Id: I0e0a989eb018c75ad1463700782bef9c7b999fa0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* qmllint: fix setting for alias cycle and unresolved aliasSami Shalayel2025-03-251-0/+3
| | | | | | | | | | | Make sure both have their own setting key, but still support the previous "buggy" setting key. Print a deprecated warning when finding the buggy setting key in a setting file. Task-number: QTBUG-135020 Change-Id: I364e7e41380de43a0883bcf4d3f6cefcf11b6c90 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmake: Don't pass empty foreign-types list to qmltyperegistrarFabian Kosmale2025-02-251-1/+1
| | | | | | | | | | | | | | Use join's before parameter to only add the foreign-types parameter to the command invocation if there is actually a list of foreign-types to handle. This avoids "cannot open foreign types file" warnings during the build process. Pick-to: 6.9 6.8 Change-Id: I142d0fab44201a3314354173ea30d2f90841a6f4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>