| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
Change-Id: I287a6e63397c2c6140c3bc3e7d83f3212709531e
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
| |
Fixes: QTBUG-98039
Pick-to: 6.2 6.3
Change-Id: I51ff36994fa0f3f3568c8114cb6841f677f64bc4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
You can now add your own, lower-case named, value types to your own
module, and use them in QML. Previously the names had been ignored, but
now you can actually declare properties using the value types.
The QtQuick value types are now handled exactly this way, and their
special casing at compile time is removed.
[ChangeLog][QML][Important Behavior Changes] You can now add your own
value types to QML modules. This works exactly like the registration of
object types, just with Q_GADGET instead of QObject/Q_OBJECT. In turn,
the QtQuick value types are only available from QtQuick now. Previously
you could declare unusable properties of QtQuick value types when only
importing QtQml. This is not possible anymore.
Task-number: QTBUG-82443
Change-Id: I5b2e867141244531cb13d789678fb7e06a6e41e7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
| |
Clang complains.
variable 'enumTableSize' set but not used [-Werror,-Wunused-but-set-variable]
Change-Id: Ifb26309a4928e8d5cac123df843f9308d1c590cb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We will need to distinguish between script and translation bindings in
the future (to correctly assign script binding indices). Moreover, the
NOOP translation functions actually produce string literal bindings, not
translation bindings.
To unify the classification of translation bindings, the code from the
IRBuilder has been converted into a template taking a few callbacks.
This change does not add validation for translation bindings yet, but a
failing autotest for a case where it would be necesseray is already
provided.
Change-Id: Icccba98edbdcd15068188807e8622c1bd513725c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
If an inner function contains a yield expression, we need to reject the
program even if that function is inside of a generator function.
Fixes: QTBUG-98356
Pick-to: 6.2 5.15
Change-Id: I2e820a1ca5f0da4080e313fd9809aa8bfdc1b681
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of directly accessing the attribute related members of
UiPublicMember, we access them via a function.
Moreover, we remove some redundancy: A property is
readonly/default/required if and only if the corresponding token is
valid. Thus we can drop the boolean members.
Change-Id: I22f15b2b037e857d2f9d3167cb761cba9516a135
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
| |
They don't change anything.
Change-Id: Iba7ecdc0658d44db5fd2060d23150e704e9446ad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Top level functions, that is, those directly defined in a QML component
as opposed to those defined inside another function or class, are not
visited directly by the ScanFunction visitor. Instead, they are manually
considered in generateJSCodeForFunctionsAndBindings, and the visitor is
then run on their body.
This worked mostly fine, with one notable exception: In case there is a
function expression used as the default value of a function parameter,
that function would have never been visited. This would lead to
subsequent asserts/crashes in the codegen, as the function was not
properly set up.
We fix this by manually visiting the function's formals in addition to
the body.
Pick-to: 6.2 5.15
Fixes: QTBUG-98032
Change-Id: I5cb4caae39ab45f01a0dfa1555099d7d4b796a19
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Windows COM headers #define interface struct, and we seem to have some
private includes pulling in a platform header, breaking builds.
Rename variables and parameters from 'interface' to 'iface'.
Pick-to: 6.2
Change-Id: I233a2b0f4a488129806a5ae05fa1080d29b36e0e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
| |
This is often faster than resizing on demand.
Task-number: QTBUG-89513
Change-Id: Ie125df2bfc25db73fc3d92040b21a526a3a65f4b
Reviewed-by: Nick Shaforostov <mshaforostov@airmusictech.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Ia0da9ecd0c0314834a7f9a7195a63717f518a2bf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][QtQml] You can now specify the list property assignment
behavior in QML using the "ListPropertyAssignBehavior" pragma. This is
analogous to the macros you can use in C++.
Fixes: QTBUG-93642
Change-Id: I9bdcf198031f1e24891f947b0990a3253d29a998
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Function declarations add their name to the outer scope, but not the
inner scope. Function expressions add their name to the inner scope,
unless the name is actually picked from the outer scope rather than
given after the function token.
We don't add the name to any scope in the case of functions declared in
QML elements because the QML element will receive the function as
appropriately named, and typed, property. It is always better to use
that one than to use a JavaScript local.
This causes some additional ecmascript tests to pass.
Pick-to: 6.2
Fixes: QTBUG-96625
Change-Id: I0b8ee98917d102a99fb6b9bd918037c71867a4a5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The necessary information is already available in the flags member.
Moreover, isInlineComponent and IsComponent (used for Component
properties) are mutually exclusive, so no need to check for inline
component flags if IsComponent is set.
Change-Id: Ibf171d63463f1e386a4063725b657aa998afd63f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The outer function may perform important tasks like setting up a call
context with a "this" member for the nested function. In particular,
arrow functions retain their original "this" member, no matter where
they are executed later. We can detect this condition while generating
the compilation unit. If the outer function is not a simple wrapper that
only returns the inner function, execute it when binding a signal.
Fixes: QTBUG-95659
Pick-to: 6.2
Change-Id: I7dfef2c78378588e6bfc4bedde7889c7f2ce03ef
Reviewed-by: Yuya Nishihara <yuya.nishihara@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want one instance of the function's static variable, so the function
must not be static itself.
This still can lead to having multiple copies in the case where multiple
shared libraries are used. But this is a) not the case currently and b)
having one copy pare library is not problematic: The variable is
stateless, and only static to ease lifetime management of the pointer.
Change-Id: Iad3ea1ec74125446d926bc6a462866aeae936811
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QQmlIRBuilder skips storing binding scripts as a string to save memory.
However, for QQmlScriptString, we need the string to be available. This
is solved by running QQmlScriptStringScanner in the type compiler at
runtime, which sets the correct stringIndex for script string bindings.
However, that one does not run when we already have a compilation unit
from cachegen (and if we would run it unconditionally, we still would
miss the source code to recover the string).
We work around this issue by noting that QQmlScriptString only cares
about a very limited set of strings: Namely the various literals and
undefined. The literals are already correctly handled, as IRBuilder has
specific optimizations for them anyway. We now check in the generic case
whether the bindings string equals "undefined", and if so, ensure that
the string is registered.
Fixes: QTBUG-91165
Pick-to: 6.2
Change-Id: I4c4696952a082d1e69e0c9e5a0b9bf2470d59187
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
| |
Change-Id: Icdd93eb63c4d73675cfbf7b3291a7c5c9eece216
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
| |
This fixes CodeChecker warning 3b7d89038c4b9842645dceb0b77b1557.
Change-Id: I6acf5566c0734f41ecccf86bcc23ef59c0f3f7df
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
| |
Another step to making checkidentifiers obsolete.
Change-Id: I14be7491387200101b66e0930faf16e9b61d4159
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Properly report the source location of FieldMemberExpressions and also report them properly when the FieldMemberExpression ends in a CallPropertyLookup.
Change-Id: I2c0eb719e98d19dec97d46cda1530208ad0120cd
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this change, they were treated as script bindings, which are less
efficient, and could not be used in ListElement.
Fixes: QTBUG-95139
Pick-to: 6.2
Change-Id: Ic66052c7f58b3ffdf1b7c0c169f42b4f99df62a1
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
| |
Previously the source locations in the bytecodegenerator were often imprecise due to them not being updated often enough.
This change makes sure that FieldMemberExpressions and IdentifierExpressions report more accurate locations instead.
Change-Id: Ib53cda5cc927551c25ed32ed34d4b65d82f5e199
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This is required for better warnings in qmlcompiler's type propagator.
Remains optional as to not consume superfluous memory when not needed (during normal QML engine operation).
Change-Id: I50293f878e4f6659935925f5f2266427d2f64d7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
| |
You should really not copy or move it around.
Change-Id: I8137d175d63fcfeb915fb5f18e237fbd3fede67a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
We need it in libQt6QmlCompiler.
Change-Id: I0582d8fda2f8cb952f04490be86408b502a13960
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
| |
Noted by GCC 11. Looks like it doesn't see the "fall through" comment
(only "fallthrough").
Change-Id: I7246c3e7bb894e0d9521fffd168af15da21a2c93
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was an oversight: We only checked that normal properties have
unique names, and that alias properties have unique names, but we
neglected to check that alias properties and properties do not have name
collisions either.
Fixes: QTBUG-94456
Pick-to: 6.2 6.1 5.15
Change-Id: I0fa7666b143bc84f4dc5b2ad6e62427adff60cd7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Type assertions actually check whether the expression matches the type,
and return null if it doesn't.
[ChangeLog][QtQml] You can use TypeScript-like type assertions using
"as" now. In contrast to TypeScript, QML's type assertions are enforced
at runtime. If the type doesn't match, null is returned for object
types. Also, type assertions can only cast to object types. There is no
way to create a value type or primitive type reference. As value types
and primitives cannot be polymorphic, this doesn't matter, though.
There are other ways of converting those.
Task-number: QTBUG-93662
Change-Id: I00fce3d4ea7a8c6b4631c580eaf6c113ac485813
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pointer is initialized to nullptr, set in enterEnvironment, and possibly
reset in leaveEnvironment. The static analyzer can't know that it is
always set before any of other functions is called, so assert that pre-
condition via Q_ASSERT.
Pick-to: 6.1
Change-Id: I0198505db40a93227ba52a08c29a351e85b74cc0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
| |
Previously when having an inline component inside any component that was not the root component, we hit an assert when using a script bindings.
This was due to us not generating script bindings for any more deeply nested components. Now they work regardless of component depth.
Change-Id: I700cf918f955aa99076006d53fb20358ff06e75f
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
| |
Fixes: QTBUG-92966
Pick-to: 6.1
Change-Id: I9acdb0d624a0950f9e28c6463530b27d282123e2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Previously parser warnings (i.e. inline components having lowercase names) were treated as errors.
Because these were not handled properly this also resulted in the QQmlComponent with the warning never becoming ready.
This resulted applications hanging instead of terminating.
Pick-to: 5.15 6.0 6.1
Change-Id: Ia5ad3b54edc1b94dd94d0bf771c3494691abec71
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Ie5a229d7e62d8df356359094e7e6d38530672a43
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change implements optional chaining (https://github.com/tc39/proposal-optional-chaining) by adding a new type of optional lookup with an offset to the end of a chain.
If `undefined` or `null` is encountered during an access marked as optional, we jump to that end offset.
Features:
- Full support for all kinds of optional chain
- With some codegen overhead but zero overhead during normal non-optional FieldMemberExpression resolution
- Properly retains this contexts and does not need to resolve anything twice (this has been an issue previously)
- No extra AST structures, just flags for existing ones
[ChangeLog][QtQml] Added support for optional chaining (https://github.com/tc39/proposal-optional-chaining)
Fixes: QTBUG-77926
Change-Id: I9a41cdc4ca272066c79c72b9b22206498a546843
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The AST is constructed in such a way that having exportAll set always
implies that a fromClause exists.
Also, clean up exportAll: We do not need a separate member to track it.
Its value is fully determined by the presence of fromClause and
exportsClause. Thus, replace it with a function.
Change-Id: Ib7db2bbaf326ecc36a7f4a2986a7c1fb54db6cd5
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
This is based on QJSValue for now, but can be extended to operate on
QMetaType/void* later.
Change-Id: Ic63d4c9081090998afcca63ff3253963ff5096a2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
We want to do that in other places, too.
Pick-to: 6.1
Change-Id: Id42495d239c2dccffa390478c8b57ec1acab7408
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
You should declare functions with formal parameters if you want to use
parameters passed by the signal. We need to generate two different
warnings because there are two code paths by which such parameters are
injected. If we compile with qmlcachegen, it simply inserts a lookup
instruction in to the byte code. This lookup then triggers our special
hack expressly made for signal parameters. If we don't compile using
qmlcachegen, a function declaration with formal parameters is
synthesized. We mark those formal parameters as injected and warn if
we see one of them used.
[ChangeLog][QML][Important Behavior Changes] The automatic injection of
signal parameters into signal handlers is deprecated. This is because we
cannot determine the names of the signal parameters at compile time.
Furthermore, also for human readers it is difficult to discern between
arguments, context properties, properties of the current object, and
properties of the root object of the component. Requiring the signal
parameters to be explicitly named resolves some of this confusion. You
can turn the deprecation warning off using the "qt.qml.compiler" and
"qt.qml.context" logging categories.
Task-number: QTBUG-89943
Pick-to: 6.1
Change-Id: If0a5082adb735a73efd793868b3a55bc7d694cbe
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This collides with injected signal parameters. qmlcachegen cannot tell
those cases apart.
[ChangeLog][QML][Important Behavior Changes] QML warns about JavaScript
variables being used before their declaration now. This is almost always
a mistake. It is particularly dangerous in the presence of injected
signal parameters because qmlcachegen cannot identify a name collision
between an injected signal parameter and a variable being used before
its declaration. It therefore miscompiles such code. You can turn off
the deprecation warning using the "qt.qml.compiler" logging category.
Pick-to: 6.1
Task-number: QTBUG-89943
Change-Id: I8a9424ca8c6edd562402fe5c560ba7e8344b5585
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-89977
Change-Id: I975a859d5252e2721475f86ced6c8dab06ae8c9c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
Remove all qmake project files, except for examples which are used to
test that qmake continues to work.
Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
This is necessary if you want to parse the same byte code in multiple
passes.
Change-Id: I8d3e9739b7cb3682d0f1d26e675ead8b7ce66a93
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This doesn't carry any meaning, yet, but it can be used by any tools to
apply stricter rules to a particular piece of QML.
Change-Id: I0bf8f22001c19c7cc2989abedc747d3d5b1bdee1
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
For grouped properties, this is the location of binding now.
Change-Id: I7148ba92150e3569d47c382ef78794bfa3b75fce
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
memcpy can't officially copy from nullptr, not even 0 bytes.
Pick-to: 5.15
Change-Id: Ie6ede9a861cb2ae7ab35a50db5aa6c82cea6ad76
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
variant and var properties differ in two important ways:
- variant properties trigger "magic" string conversions:
variant v1: "red" // contains a QColor
var v2: "red" // contains a string
- variant properties behave differently for value types: they create
copies, instead of references.
However, as variant properties were marked as obsolete and this
behavior was effetively undocumented, it should be safe to give "variant"
"var semantics".
With this change, we can also avoid doing magic conversions when storing
data in QVariant properties of QObjects/QGadgets
Change-Id: I549b1beb98e6af9639c1ee81f316bda513d5ff65
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
Task-number: QTBUG-84319
Change-Id: I2dcfb8a2db98282c7a1acdad1e6f4f949f26df15
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Drop all the double spaces, force a line break after each class, and
avoid converting empty strings to utf8.
Coverity-Id: 190711
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I789291e257aeac97c2a931bfc604f453c39906eb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|