summaryrefslogtreecommitdiffstats
path: root/src/tools/ifcodegen
Commit message (Collapse)AuthorAgeFilesLines
* Make ifcodegen build compatible with hexadecimal version valuesZoltan Gera41 hours2-1/+8
| | | | | | | | | | Although the repo version is given in an other format, our solution in ifcodegen should also conform to QT_DISABLE_DEPRECATED_UP_TO and QT_WARN_DEPRECATED_UP_TO given in hexadecimal formats. Pick-to: 6.11 Change-Id: Icd6844d181609b47423c93c8a3dd795a324448b2 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Fix format of QT_DISABLE_DEPRECATED_UP_TO valueVolker Hilsheimer41 hours1-1/+1
| | | | | | | | | The value has to be provided in hexadecimal, and configure started to fail with error when the value was in the wrong format. Pick-to: 6.11 Change-Id: I03f682b2feed1a7015b00169d3e0bbae3bdc226f Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Support building against older Qt versionsDominik Holland42 hours1-0/+4
| | | | | | Pick-to: 6.11 Change-Id: Ib7d58a8aebd7d05f190c52be87e9eb54748793b8 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* ifcodegen: Fix backward compatiblityDominik Holland42 hours2-2/+213
| | | | | | | | | | | | * Add the deprecated_filter back, as this might be used by customers * Fix qtif_macros.j2 We can't use include here, as it contains macros. Instead we keep the old file for now, but still mark it as deprecated. Pick-to: 6.11 Change-Id: Idc7c62e2d0d9164add12beef558d9749561f1de9 Reviewed-by: Zoltan Gera <zoltan.gera@qt.io> Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Compatibility layer for deprecated and commonly used Jinja filesZoltan Gera9 days20-0/+63
| | | | | | | | | | | | | | | Using deprecated common template files is still possible from other templates but a warning is given about their deprecation. We aim to remove them in Qt 7. A test is also modified to enforce this removal when the time comes. [ChangeLog][ifcodegen] Renamed Jinja template files to use standard .jinja extensions, deprecated old .tpl extensions. Fixes: QTBUG-140720 Pick-to: 6.11 Change-Id: Icd359ca338215408810fb482b3ffbc8e1cf65da7 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Add deprecation handling to JinjaZoltan Gera9 days3-9/+81
| | | | | | | | | | | | | | | Two new global functions are added to Jinja which can deprecate both templates and filters alike. The deprecation logic is based on the newest macros in C++ which handle both deprecation version and the version for code removal. In case of removal, an error fails the build. CMake configuration variables are also introduced which can set warning and error version boundaries respectively. [ChangeLog][ifcodegen] Introduced deprecation primitives for templates. Pick-to: 6.11 Change-Id: I0c4e56f84f674a0e6d6bb90968687e31b6e250a2 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Fix references to Jinja sourcesZoltan Gera9 days54-151/+151
| | | | | | | | | | Include and import references to Jinja sources and build system references to template files are fixed to use the changed extensions. Task-number: QTBUG-140720 Pick-to: 6.11 Change-Id: I427264a45fc3eca5aaea92e7a2cac19cce44b5b7 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Rename template file extensions to standard Jinja onesZoltan Gera9 days77-81/+81
| | | | | | | | | | Trivially rename template files and the corresponding yaml descriptors, so they can be modified in a second step. Task-number: QTBUG-140720 Pick-to: 6.11 Change-Id: Ica684442a79782553407878d4b12093ef7d9ba25 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Fix deprecation in QQmlPropertyMapZoltan Gera2025-11-261-1/+1
| | | | | | | | Replace deprecated constructor of QQmlPropertyMap with the suggested factory method. Change-Id: I8d0bacbe11a3071626cc0b77641f15f7677077bc Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* ifcodegen: Upgrade pip inside venvOlli Vuolteenaho2025-09-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | When creating a virtualenv with venv the pip version inside the virtualenv is not necessarily the same as the version that is used outside it. For example, when creating a venv with Python 3.8.1 the virtualenv will have pip 19.2.3. Our scripts update all the pips to their latest versions when provisioning the machine, but this doesn't get passed to the virtualenvs. On Windows ifcodegen is built with the aforementioned Python 3.8.1. As of today PyYAML released version 6.0.3, which doesn't provide wheels for Python 3.8 anymore. Therefore our build process needs to build PyYAML from a tarball but this fails with the old pip version being unable to do that. To solve this let's upgrade pip inside the virtualenv after creating it. The upgrade will automatically use the latest supported pip for that Python version, so everything should work fine and dandy for now. Pick-to: 6.10 6.10.0 6.8 6.5 Change-Id: I0571d347baa2899a75c9cff7becdc9857a427e96 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* CMake: Create an SBOM package for the ifcodegen toolAlexandru Croitor2025-06-121-0/+20
| | | | | | | | | | | | | | | | | | | The ifcodegen tool is not a regular c++ binary, it's rather based on Python. That's why there is no automatic SBOM package created for it. Manually add an sbom target, reference the relevant attribution dependencies, and add the main "executable" file as part of the package. The sbom target name needs to be different from ifcodegen, because that's already taken by add_custom_target, and the sbom target can't handle UTILITY targets at the moment to reuse the same name. Pick-to: 6.8 6.9 6.10 Task-number: QTBUG-137388 Task-number: QTBUG-129602 Change-Id: I3acbc4f30835e91596133e87d06c7ee8f71c16ca Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Fix CMP0177 warningsAlexandru Croitor2025-04-281-2/+2
| | | | | | | | | | | | | | | | | INSTALL_DATADIR and INSTALL_ARCHDATADIR have the value "." by default. CMP0177 in CMake 3.31 now warns when paths that have "." as a component are passed to install(). To avoid the warning, pass each component of the path separately to qt_path_join, so that it can properly filter out ".". This change will have only have an effect once a newer qtbase is brought in with the updated qt_path_join behavior. Pick-to: 6.8 6.9 Change-Id: Ib9cd2b572d51be344794f26612f9a94465767ed7 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* ifcodegen: Add missing find_package call for Private packagesDominik Holland2025-03-254-3/+41
| | | | | | | | | Since QTBUG-87776 is implemented we need to explicitly call find_package with the Private CMake packages in order to link them. Pick-to: 6.9 Change-Id: Id8cbd57b6a562a492adc20bb3934f47b747a2867 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Update license checkLucie Gérard2025-03-201-1/+1
| | | | | | | | | | | | | | | | The module is now: - checked against quip18 [1] rules (licenseRule.json) - reuse compliant (REUSE.toml) - ready for source SBOM check [1] https://contribute.qt-project.org/quips/18 [ChangeLog][Third-Party Code] Rename license file with LICENSE. prefix. This way the file is ignored by the reuse tool. Task-number: QTBUG-131434 Pick-to: 6.8 6.9 Change-Id: Iaa52f0125719f5172f2e7522df816fcd3ced4928 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Disable Python3 targets global promotingAlexey Edelev2025-01-151-0/+3
| | | | | | | | | | | | | SBOM procedures expose the Python3 package at very early stages, so 'qt_find_package(Python3' call fails to promote the Python3::Interpreter to global scope. Disable the global promotion of the Python3::Interpreter target if it's created before attempting to call 'qt_find_package(Python3'. Fixes: QTBUG-132791 Pick-to: 6.8 6.9 Change-Id: Icfbc04d1853de941959619fb7da99e977711fa44 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Fix build issue on Android by adding Qt6 GUI module dependencyShveta Mittal2024-12-171-0/+1
| | | | | | | | | | Resolved a build issue on Android by ensuring the Gui module from Qt6 is included as a required dependency. Fixes: QTBUG-131579 Pick-to: 6.9 Change-Id: I3a6de1c773ebbaabd8c04cc4a1ebd6dbbf8ab114 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Enhance defaultServerMode with Android option and update annotationShveta Mittal2024-12-042-28/+77
| | | | | | | | | Added 'android' as a valid option for defaultServerMode, expanding beyond the previous 'gui' and 'headless' options. Moved defaultServerMode under the 'config' annotation for better organization, previously under 'config_simulator'. Task-number: QTBUG-130660 Change-Id: Ib7b730badbe47721c0a826c65ef4fb5832fc5ea0 Reviewed-by: Dominik Holland <dominik.holland@qt.io> Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
* Add flag for capturing target platform in generatorShveta Mittal2024-11-221-7/+9
| | | | | | | | This commit introduces a new flag to the generator to capture the target platform. This information will be passed from CMake to the Jinja templates, allowing for dynamic decision-making within the templates based on the specified target platform. Task-number: QTBUG-130661 Change-Id: I95fd6e075671b961c413c79a6342b538a96dd0f4 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* qdoc: Fix \instantiates deprecation warningDominik Holland2024-08-222-2/+2
| | | | | | | Pick-to: 6.8 Change-Id: I0dbaa8419a75e26e6925cac33792dc4737aba345 Reviewed-by: Robert Griebl <robert.griebl@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Register more QML types and their dependencies part 3Dominik Holland2024-08-221-1/+1
| | | | | | | | | | All QML_VALUE_TYPES need to start lowercase Pick-to: 6.8 6.7 6.5 Change-Id: I4a8b37229b0bb30595bcf4db25210cd5b8fb6e4f Reviewed-by: Soheil Armin <soheil.armin@qt.io> Reviewed-by: Robert Griebl <robert.griebl@qt.io> Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
* ifcodegen: Deprecate the qmlplugin template for CMakeDominik Holland2024-08-221-0/+10
| | | | | | | | | Show a warning to the user, that this template should only be used when porting from qmake. Pick-to: 6.8 Change-Id: I69a7ff593aa029fd9ddc91cd3c0d6156695917cf Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* ifcodegen: Integrate a selfcheck modeDominik Holland2024-08-083-23/+87
| | | | | | | | | | | | | This selfcheck mode creates a small qface file and a minimal template inside a temp folder and runs the generator. In case the generation fails a error message is shown to help the developers to identify the problem and how to workaround it. The new selfcheck is automatically executed after building ifcodegen. Pick-to: 6.8 6.7 6.5 6.2 Change-Id: I04838f14908de3a175aecf38d6a80e48fa33f891 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Register QIfPendingReply as a value type for QMLDominik Holland2024-08-072-0/+8
| | | | | | | | | | | | | | | | | Although QIfPendingReply is a template class, only it's base class QIfPendingReplyBase is usable from QML. But as we use the template class in the C++ signature, we need to go some extra miles for the QML registration. This is now done by QIF_DECLARE_PENDINGREPLY which needs to be called for new types and is now automatically done for auto generated structs. All basic types are already registered and can be used without any additional steps. Pick-to: 6.8 Change-Id: Ibd82a1dd5dcd9bae0e32ca996f37d1dcafe4cbaa Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Register more QML types and their dependencies part 2Dominik Holland2024-08-071-1/+2
| | | | | | | | | | * Register QList<QIfServiceObject*> as a container for QML * Register QIfServiceHandle as a QML value type * Register generated structs as QML value type Pick-to: 6.8 6.7 6.5 Change-Id: I2bc75be08521d6428c3e83fe1629879e79efae60 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Update the bundled qface to the latest version (2.0.10)Dominik Holland2024-08-012-3/+3
| | | | | | | Change-Id: I6b24049df326be28b7a898a42ff2f72a51a61522 Pick-to: 6.8 6.7 6.5 Fixes: QTBUG-127627 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Pin tooling dependencies to avoid breaking builds caused by 3rd partiesZoltan Gera2024-07-243-2/+6
| | | | | | | | | | | | Nuitka 2.4.0 introduced a problem with command line arguments and broke the build suddenly. Just like in case of runtime library dependencies, we should also pin tooling dependency versions. Patch releases are left relaxed for now in case of tooling. Pick-to: 6.8 6.7 Change-Id: Iabf89e4ddc2949ded0f0a5334d33c0363ec35378 Reviewed-by: Olli Vuolteenaho <olli.vuolteenaho@qt.io> Reviewed-by: Simo Fält <simo.falt@qt.io>
* ifcodegen: Fix qtro templates to always include the generated rep codeDominik Holland2024-07-103-0/+3
| | | | | | Pick-to: 6.8 6.7 6.6 6.5 Change-Id: Ifc2e43710f254b6d0e747e9c97f920c5769b4c76 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* ifcodegen: Register structs only as anonymous typesDominik Holland2024-06-251-1/+0
| | | | | | Pick-to: 6.8 6.7 6.6 6.5 Change-Id: Ib8f0f4796401bd3ef1ec6162ca861efc6ce0889f Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* ifcodegen: Optimize loading time of backend_simulator pluginsDominik Holland2024-06-181-2/+2
| | | | | | Pick-to: 6.8 Change-Id: I298364b6c9946202fa373f967d14182c9585bd88 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Use Python venv instead of virtualenv everywhereZoltan Gera2024-06-056-592/+162
| | | | | | | | | | | | | | | | Python has venv in its standard library set, so using it instead of the virtualenv package can make virtual environment deployment easier with less dependencies used. The newer venv package is now used for both compiled and interpreted workflows. Instead of making virtual environments relocatable, they are distributed with a generated requirements file which makes it possible for them to be regenerated after relocation. Fixes: QTBUG-104239 Pick-to: 6.8 Change-Id: I7795457be74637188ad1b1c448cca117491e4799 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* CMake: Add a new qt_ifcodegen_add_plugin functionDominik Holland2024-05-292-0/+8
| | | | | | | | | | This makes it easier to generate backend plugins while making sure those plugins are of the correct type and use the correct class name to support static linking. Fixes: QTBUG-123370 Change-Id: I4f32cce7df308bbe320a2063b5a9840de77a050f Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* ifcodegen: Fix the plugin class name in the backend_qtro templateDominik Holland2024-05-292-2/+2
| | | | | | | The plugin class name should always start with a upper case letter. Change-Id: Ib28b33a319cbf1d128c61b96050dde467632d1e2 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Add better support for static backend pluginsDominik Holland2024-05-291-0/+3
| | | | | | | | | | | | | | | | | | Correctly initialize the resources in the simulation plugin when build statically. Also make sure the QIfServiceManager always uses the id from static plugins to dissambiguate plugins. The main part of this commit is the refactoring of the backends autotest into several test binaries using a common base class. This is needed as static simulator plugin and dynamic simulator plugin can't be loaded into the same process. This should also make it easier to add backend specific tests in the future. Pick-to: 6.7 Change-Id: I326b6e1a11b80b7992893cf3955f86e07f5236f8 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Remove warnings for newer clang compilersZoltan Gera2024-05-161-2/+2
| | | | | | | | | | | | | The generated queryparser had an unread variable and the generated tests also had one membered initializer lists. These produce warnings from clang version 15 and up, now being standard on Macs and also in the Android NDK. The warnings are removed and the generated queryparser is updated in the repo for developers not having flex installed. Change-Id: Icaf9ef6a13838045426025a9471d4c1f108bcfb9 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* CMake: Rewrite commands which are always executedDominik Holland2024-02-141-1/+5
| | | | | | | | | Some commands were always executed and caused some things to be rebuild or copied, although there was no need for it. Pick-to: 6.7 Change-Id: I5743bfe540cf67d4df661f7f7a5324f30bed8c93 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Fix memory leaks found by the Address SanitizerDominik Holland2024-02-144-5/+18
| | | | | | Pick-to: 6.7 6.6 6.5 6.2 Change-Id: I7095ffb9fc26dc6d74b11cf22d73c8cd844a1dcd Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* ifcodegen: Also deploy dataclasses.py needed by watchdogDominik Holland2024-02-071-0/+1
| | | | | | | Pick-to: 6.7 6.6 6.5 6.2 Fixes: QTBUG-122036 Change-Id: I71d584707e32c8d53dbb8e3024be64125a2e0572 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* QIfRemoteObjectsConfig: Fix typo in function nameDominik Holland2024-01-222-2/+2
| | | | | | Pick-to: 6.7 Change-Id: Ic28c98e57e783c0078b1a2ecc50d64a10b884e37 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Fix templates using QtIfRemoteObjectsHelper module for standalone buildsZoltan Gera2023-12-153-6/+6
| | | | | | | | | | | | | The QtIfRemoteObjectsHelper library was promoted into a module earlier. The CMake project files generated by our templates did contain a part for builds where this module is already built and installed. However, this was not revealed by tests where tests and examples are built in the same round with the module itself. In the standalone build case, the module is now referenced and searched for correctly. Pick-to: 6.7 Change-Id: I3a8b96a50a536264dab24309e4aaccdb24fd001d Reviewed-by: Dominik Holland <dominik.holland@qt.io>
* Fix parsing of enums from simulationDataDominik Holland2023-11-241-0/+1
| | | | | | | | | | Although all types are registered correctly the module class hosting all enums is not always correctly registered to the MetaType system. Fixes: QTBUG-119428 Pick-to: 6.6 Change-Id: Id425f59ebde334724f8eb9fdd512e8f339c9a8a8 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Deprecate the autogenerated Core classDominik Holland2023-11-134-11/+41
| | | | | | | Instead the new QIfRemoteObjectsConfig should be used. Change-Id: Id98e73f9a567272a7516157088c90746748cdad3 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* ifcodegen: Add a autogenerated main to server_qtroDominik Holland2023-11-135-0/+64
| | | | | | | | | | | | | | | | It can be used using a module annotation and generates a main.cpp with the same command-line arguments as the server_qtro_simulator. The generated main instantiates a QIfRemoteObjectsConfig which is forwarded to a serverMain() function, which needs to be implemented by the user. The provided config instance, can be used to enable remoting of the services. Task-number: QTBUG-113105 Change-Id: Ief94ea11be96453f306c712c2115854837d054f8 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Introduce QIfRemoteObjectConfigDominik Holland2023-11-131-3/+16
| | | | | | | | | | | | | | | Acts as a replacement of the autogenerated Core class. The new class isnot autogenerated, but part of the QIfRemoteObjectsHelper lib and instead of providing a single QRemoteObjectHost class for all interfaces and parsing a hardcoded config file, the new class is more flexible. Fixes: QTBUG-99085 Fixes: QTBUG-113105 Change-Id: I15adb12b2faa0d8c5909622bef898ccdc2f324d8 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Promote the QtIfRemoteObjectsHelper lib to a proper qt moduleDominik Holland2023-11-139-7/+10
| | | | | | | | | | | Instead of being a static private library it is now a dynamic library with public code including documentation. This makes it possible to host more code which is QtRemoteObjects specific. Change-Id: I3ff601add349d4fad721890c12fc6e59fbe4ee79 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* ifcodegen: fix generation with older jinja2Samuli Piippo2023-08-141-1/+1
| | | | | | | | | Older jinja2 (2.x) doesn't allow disabling trim_blocks at the end of the statement block: https://github.com/pallets/jinja/issues/750 Pick-to: 6.6 Change-Id: I451e3fdbb93cc3ecbb0c3f6b9f0f056676c2d39a Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* ifcodegen: Add support for deprecating annotationsDominik Holland2023-08-101-0/+30
| | | | | | | | | | When a deprecated annotation is used a warning is printed. The CMake integration has been improved to also forward those warnings to the user. Pick-to: 6.6 Change-Id: Ib77dcbb58f9697b8dfb1f2cf837319f371a0578e Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* ifcodegen: Fix module QML registrationDominik Holland2023-07-311-1/+1
| | | | | | | Fixes: QTBUG-115600 Pick-to: 6.6 6.5 Change-Id: I5d8f29891f9ce010eb3ff2ba4751f131ed8d7aa4 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* ifcodegen: Improve the settings parsing in the backend_qtro templateDominik Holland2023-07-202-12/+54
| | | | | | Pick-to: 6.5 6.6 Change-Id: I2e2798461f53556a449ae6887bd8f099c4965e6b Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* ifcodegen: Update models in the qtro_backend to use the new connection settingsDominik Holland2023-07-194-13/+90
| | | | | | Pick-to: 6.5 6.6 Change-Id: Iecb969220e4d8dd9426912dd95221e6e94b5432b Reviewed-by: Robert Griebl <robert.griebl@qt.io>
* Mark properties exposed to QML as FINAL to prevent shadowingDominik Holland2023-07-183-3/+3
| | | | | | Pick-to: 6.6 Change-Id: Ief99e708d61dcb49c63fd089fb7a1b81ab6a849a Reviewed-by: Robert Griebl <robert.griebl@qt.io>