Commit Graph

17 Commits

Author SHA1 Message Date
Simon Hausmann 41864db3b6 Fix *.js files disappearing from RESOURCES when not using QtQml
[ChangeLog][QtQml][Important Behavior Changes] Using the Qt Quick
Compiler would exclude the original .qml files from the resource system.
This made it impossible to change the Qt library binary later as the
program binary was tied the to the exact Qt version. In addition
sometimes unrelated files (QTBUG-73669) were removed. For the latter
scenario, retain and skip options were added for the Qt Quick Compiler.
In Qt 5.15 the Qt Quick Compiler does not remove the input files
anymore. All files are retained and the compiler merely adds the more
efficient binary representation to the application.

Task-number: QTBUG-73669
Change-Id: I5a523bfc69d4f48a1451bd880616c82fd73b8d15
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-09-09 07:52:25 +02:00
Tasuku Suzuki 6b106d4463 Fix build without features.temporaryfile
Change-Id: If990efb64a4117bc7624062fededa7ce6a910f14
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-19 22:06:26 +09:00
Marc Mutz 415bba6cfe Port to somewhat stricter implicit conversions to QChar
Currently, QChar can be implicitly converted from nearly any integral
type. The goal for the future is to allow only actual character types
((u)char/char16_t) to implicitly convert to QChar. This patch prepares
the code for such a change.

Change-Id: I6db0a9214c48912e11ce6e90050223fa9dd8d3a2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-07-02 10:21:10 +02:00
Qt Forward Merge Bot 63398defdb Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I59343fe228ca6b823b61577e5a0907e7381899c2
2019-06-28 13:28:10 +02:00
Mitch Curtis abfa03d702 Unregister unit cache hook when destroying the plugin singleton
At the point the plugin is actually unloaded the hook turns into a
dangling pointer.

Fixes: QTBUG-71387
Change-Id: Ib8ccee3f9a86d4700fbea7e87c666cd8f30f71e4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-06-25 15:52:47 +02:00
Ulf Hermann b84927dc2b qmlcachegen: Eliminate foreach
Change-Id: Ic13e5af7ddb92cf5988988ebe1c2b7470a5f8c1e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-01-04 14:29:09 +00:00
Ulf Hermann 21ffde85a1 Add option to retain sources when generating QML cache
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>
2019-01-04 14:13:49 +00:00
Sergio Martins 7e6ede9d5d Fix warnings about unused Qt containers
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>
2018-11-30 10:06:55 +00:00
Samuel Gaist 34c246191c QMLCacheGen: add missing QRegExp include
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>
2018-11-17 22:06:30 +00:00
Joerg Bornemann 27a6b12234 qmlcachegen: Remove superfluous semicolons from generated code
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>
2018-06-19 13:39:09 +00:00
Simon Hausmann 0996f18b25 Fix CONFIG+=qtquickcompiler with umlauts in the file path
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>
2018-06-19 13:30:35 +00:00
Simon Hausmann e09a02fac0 Fix CONFIG+=qtquickcompiler with paths that contain spaces
Map spaces to underscores as well.

Task-number: QTBUG-54683
Change-Id: Id73c086a2845111623df631c06733ba2b42249e0
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-27 18:44:32 +00:00
Simon Hausmann e1d32c8066 Fix CONFIG+=qtquickcompiler with Q_CLEANUP_RESOURCE
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>
2018-03-19 10:37:31 +00:00
Shawn Rutledge 06e962f263 init variables where they are declared when possible (clang-tidy)
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>
2018-02-26 13:08:30 +00:00
Shawn Rutledge 499ec43937 use nullptr consistently (clang-tidy)
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>
2018-02-26 07:13:18 +00:00
Simon Hausmann 6ef66a5dfe Remove private API dependency of qmlcachegen generated code
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>
2018-01-28 16:37:30 +00:00
Simon Hausmann e5b157275d Add support for compiling QML/JS files ahead of time in resources
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>
2018-01-28 16:37:26 +00:00