Commit Graph

11 Commits

Author SHA1 Message Date
Lucie Gérard 9c5fc88388 Correct license for test files
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I26d72e8de04d4c7c57b3b7838af5d033265de5ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-02-27 10:32:21 +01:00
Ulf Hermann 72e9f47526 QmlCompiler: Allow write-back to members of objects
This covers recursive write-back, but not write-back to members of
singletons or attached types, write-back of lists.

Task-number: QTBUG-116011
Change-Id: I6d33fae3bf9fdaed8d696a708124e0a707ecb07e
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-08-24 12:39:43 +02:00
Ulf Hermann e6dd62ff19 QmlCompiler: Do check specificType on SetLookup
We may have implicitly invalidated it when shadow-checking.

Amends commit b3281f123e.

Change-Id: Ia5c54a3a0fa97c61e947ecb0a5b21d410e1bf19a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-15 10:46:27 +02:00
Ulf Hermann 518509297f qmltyperegistrar: Strip '*' from list value types
We do this for function return types, property types, and function
argument types already. Formally, we would have to store some
"isPointer" somewhere, but considering that we never read it anyway,
let's not go there.

This allows the compilers to recognize lists of QObject-derived types as
proper lists. This way we can generate better code for moving them
around or getting their length.

Pick-to: 6.5
Task-number: QTBUG-110438
Change-Id: I35e0fc21d574afc18799e9c3cef402f05b60a3ed
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2023-01-25 18:08:36 +01:00
Ulf Hermann 1969a10821 QmlCompiler: Support conversions between QString and QByteArray
Pick-to: 6.4
Fixes: QTBUG-104702
Change-Id: I80d3a28e17751d440ec4bea4c7be0d09c935fa19
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-22 21:30:12 +02:00
Ulf Hermann 8dc33d3672 QmlCompiler: Don't crash on unknown list value types
Pick-to: 6.4
Fixes: QTBUG-104743
Change-Id: I551b21498bb746acf05be525dbcb72a74f816c04
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-06 21:28:05 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
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>
2022-06-11 08:05:15 +02:00
Sona Kurazyan 2c9c1590e6 Replace uses of deprecated _qs with _s/QStringLiteral
Task-number: QTBUG-101408
Change-Id: Ic925751b73f52d8fa5add5cacc52d6dd6ea2dc27
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-04-29 09:47:43 +02:00
Ulf Hermann 871024cdce QmlCompiler: Fix licenses in test files
Those are not commercial-only anymore.

Change-Id: I4ebb6fa4b8295b9e5cbb901ab39e30df6e0c85ce
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-28 09:43:36 +02:00
Ulf Hermann bd0f4459ce Re-allow retrieval of list properties in QQmlJSCodeGenerator
It's not particularly slow. It probably was when we were using
QQmlListReference or JavaScript arrays.

Pick-to: 6.3
Change-Id: I1a4575a5b84cdfb732a6c3615d00bbe2abaffc94
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2022-01-15 14:22:42 +01:00
Ulf Hermann 58ff7aa4fe Compile QML files ahead of time with qmlcachegen
qmlcachegen compiles bindings and functions to C++ as far as
QQmlJSAotCompiler can. It does respect "pragma Strict" and rejects the
file if it's violated. Furthermore, it sets up the logger to follow the
qt.qml.compiler.aot logging category. By default it's completely silent.

Compiling the examples with qmlcachegen exposes a bug in the type
resolver where it returns an invalid generic type. It should never do
that. Fix it by returning JSValue.

[ChangeLog][QtQml][Important Behavior Changes] QML bindings and
functions are now compiled to C++ by qmlcachegen, if possible. Use the
qt.qml.compiler.aot logging category to receive diagnostics about the
compilation.

Task-number: QTBUG-98305
Change-Id: I6953812c3fd20b68339617a5714fcbe16a384360
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-03 12:09:26 +01:00