aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlcachegen/generateloader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* qmlcachegen: Eliminate foreachUlf Hermann2019-01-041-1/+1
| | | | | Change-Id: Ic13e5af7ddb92cf5988988ebe1c2b7470a5f8c1e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add option to retain sources when generating QML cacheUlf Hermann2019-01-041-4/+11
| | | | | | | | | | | By default any .qrc files are filtered and QML and JS sources dropped when generating the cache. The new QTQUICK_COMPILER_RETAINED_RESOURCES option allows the specification of .qrc files to be kept as they are. The source fils specified in them will be available to the application. Change-Id: If45bcd95c29fe4b91f5817573964ff55b1db8a00 Fixes: QTBUG-72430 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix warnings about unused Qt containersSergio Martins2018-11-301-1/+1
| | | | | | | | | | | Fixes -Wclazy-unused-non-trivial warnings, in preparation for using gcc/clang's warn_unused attribute in all containers. Maintainers please check if some unused variable isn't hidding an actual bug. Change-Id: I83c5a11aa2328db3dce4c6c402295d86ef297c83 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QMLCacheGen: add missing QRegExp includeSamuel Gaist2018-11-171-0/+1
| | | | | | | | | Following qtbase's QRegExp include cleanup, this patch adds it here. This also follows the "include what you use" philosophy. Change-Id: I2692736e37bca304b7f95563b98c92cf01c7aedb Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* qmlcachegen: Remove superfluous semicolons from generated codeJoerg Bornemann2018-06-191-2/+2
| | | | | | | | | This fixes the "extra ';'" warnings when compiling generated code with -Werror=pedantic. Task-number: QTBUG-68809 Change-Id: Ie26cdc4e06bc26587766dd72b258624773a7f990 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix CONFIG+=qtquickcompiler with umlauts in the file pathSimon Hausmann2018-06-191-6/+48
| | | | | | | | | | | | | | | Instead of replacing every character that is not allowed in C++ identifiers with an underscore (which in turn could lead to collissions), replace it with the hexadecimal value of the offending character's unicode value. In addition we must use the complete suffix when mapping Foo.qml to Foo_qml.cpp. Task-number: QTBUG-68608 Started-by: Erik Verbruggen <erik.verbruggen@qt.io> Change-Id: I7e2153f0e6671b37dcaee4efb9aaae1d9b230f0c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix CONFIG+=qtquickcompiler with paths that contain spacesSimon Hausmann2018-03-271-0/+1
| | | | | | | | Map spaces to underscores as well. Task-number: QTBUG-54683 Change-Id: Id73c086a2845111623df631c06733ba2b42249e0 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Fix CONFIG+=qtquickcompiler with Q_CLEANUP_RESOURCESimon Hausmann2018-03-191-3/+11
| | | | | | | | | As we provide the init resources wrapper, we must also provide the cleanup wrapper. Change-Id: I7e45ae48ba955e70ffd8e253d4d2c15d0a50dabe Task-number: QTBUG-67087 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* init variables where they are declared when possible (clang-tidy)Shawn Rutledge2018-02-261-4/+2
| | | | | | | | clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-1/+1
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove private API dependency of qmlcachegen generated codeSimon Hausmann2018-01-281-7/+1
| | | | | | | | | Since the compilation unit does not have a backend anymore, we can create it in QtQml itself instead of in generated stub code. That removes the last dependency to private headers in the generated code. Change-Id: I186fc5bd679476b1a4714e4e3ba0ac00b55676cf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add support for compiling QML/JS files ahead of time in resourcesSimon Hausmann2018-01-281-0/+398
This is bringing over the loading infrastructure from the Qt Quick Compiler that allows embedding qml/js files in resources and compiling them ahead of time. At the moment, the approach of generating one cpp file per qml/js file and the loader stub is needed because the build system does not support dynamic resource generation. In addition, as per QTBUG-60961, we must ensure that the generated data structures are aligned. To retain compatibility this is enabled via CONFIG += qtquickcompiler, but we may need to find a new name (but should keep the old one in any case). Task-number: QTBUG-60961 Change-Id: Ia9839bf98d3af4c50636b6e06815364a9fc7ee57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>