| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
Add execution function that can evaluate runtime functions available
in the compilation unit. Private API for now as it's unclear what would
be a comprehensive solution to support all existing use cases
Task-number: QTBUG-84368
Task-number: QTBUG-91039
Change-Id: Icf755b53484587d7983eaae4821c1aa0111d5c05
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
| |
Change-Id: I4154a0b5c7115375292794e0564d2f3657e6b4dd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Move the value type registry into QQmlMetaTypeData. This way we can
conveniently drop the relevant entries when unregistering a type.
Fixes: QTBUG-86946
Change-Id: Id024a34a8b2b622fd9417fc0e52864b43c66cc01
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I13304631a9870874fb130cd9e6598065fc952a71
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
As part of adding qHypot() in qtbase, we now have a robust efficient
implementation of arbitrarily-many-parameter hypot(), so reuse it.
Change-Id: Iafd0eee84f3271c37003431a5f2b1a62d7ef6f86
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Round 0.49999999999999994 correctly
Task-number: QTBUG-90444
Change-Id: I0e8a19fb52540c6e976308089a782f1f472bc77f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
|
|
|
|
|
|
|
| |
The "in" operator may throw an exception.
Change-Id: I7d0b6e2212ac6ec237fbf14719349f8e23810028
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Old API assumes sender == receiver, which results in wrong handling of
connections when receiver is deleted: connection is not removed or
notified elsehow as it's not really tied to a valid receiver
Task-number: QTBUG-86368
Pick-to: 5.15 6.0
Change-Id: I0f3115f1b0f26cf353752ba2b8fd88e0f3bdd388
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We special case writing functions to properties, only allowing assigning
them to var properties and QJSValue properties.
This would however break when aliases are involved. This commit fixes
the issue by resolving the alias, and then checking and writing to the
resolved property.
Fixes: QTBUG-90373
Pick-to: 5.15 6.0
Change-Id: Ia09ebe92feeaf8359c99ff9aeadc676b9fcfaa07
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we load the same file multiple times, we can re-use the old mapping.
In fact we may leak memory if we don't. The fact that we have to use a
mutex here is somewhat regrettable, but I haven't found a better way
of serializing access.
Task-number: QTBUG-89659
Pick-to: 5.15
Change-Id: Iaa44ac80faa5e95f30c05e950ab35083a8b0416b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we cannot mprotect() we have to abort the JIT compilation. Delete
RepatchBuffer.h as it is unfixable in that regard. Luckily we don't use
it.
Task-number: QTBUG-89659
Pick-to: 5.15
Change-Id: Ic5ddbdf51b471db4ddeaa75aab48b24c1f7ced56
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We need the compilation unit, and a way to retrieve JavaScript metatypes
from it. Also, prepare for cases where we only have a QJSEngine, not a
QQmlEngine, and pass the scope object as part of the AOT context.
Change-Id: Ica81e92c99f3c9b6baffd04db1e0e91603fd2ac7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Fixes: QTBUG-85602
Change-Id: I7cdd83c16bec76c8f902c9136fa89decfc1cbd3d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A QJSManagedValue is a view on a QJSValue which always knows the engine
the value belongs to. This allows us to implement the JavaScript
semantics of the various QJSValue methods in a much more rigorous way.
[ChangeLog][QtQml] The new QJSManagedValue should be used instead of
QJSValue for manipulating properties and prototypes of JavaScript
values, as well as for calling JavaScript functions.
Change-Id: I9d445ffcf68dfa72dba9bae0818e83c80665ad66
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We don't want to call into the engine just for adding two numbers.
This implements the most common operators on primitive JavaScript
values. More are to follow in the future.
Change-Id: Id51a5af59a3af9fec78a2d8f293e59e6567e9204
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
If the target of a proxy was extensible, we did not set the
iteratorTarget to its correct value, and thus the ForInIteratorObject
would not be usable.
Pick-to: 6.0 5.15
Fixes: QTBUG-86323
Change-Id: Id1924ac4087bab38c006b8eba92b619b79d36b7a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
makeWritable() rounds the memory down to the next page boundary. Usually
we include the exception handler this way, unless the offset from the
page boundary is less than the exception handler size. Make it explicit
that we do want the exception handler to be writable, too.
Fixes: QTBUG-89513
Pick-to: 5.15 6.0
Change-Id: I2fb8fb0e1dcc3450b036924463dc1b40d2020c46
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with
move semantics, its name is misleading. Q_RELOCATABLE_TYPE was
introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE
is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE
by Q_RELOCATABLE_TYPE in QtDeclarative. As the two are synonymous, this
patch should have no impact on users.
Task-number: QTBUG-86829
Change-Id: I5bb418483a3b06619abb4ff62cf0290a7b3bcd4f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
Previously it would only disable loading of separate cache files.
Change-Id: Iae92fc03d2e5566ef7dc44a6730b788b7512fd3d
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This patch removes a workaround for old versions of MSVC; we should be
able to rely on the standard library nowadays.
Original-patch-by: Alexander Neumann
Fixes: QTBUG-89203
Change-Id: I8047565000fc7e4e3b8ac28584ff4a479b648274
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
| |
Fixes: QTBUG-83599
Pick-to: 5.15
Change-Id: I8909f0b2d3eca909512b99c172c8dc5e93e48482
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
This time, the ValueTypeFactory gets converted. As a consequence, many
callers get touched again.
Task-number: QTBUG-88766
Change-Id: I3a8b7d5cfeb7fac85daf1702febba205971d4256
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Also, allow conversion from UrlObject and String. We allow the string
conversion because we treat string and url as interchangeable in various
places.
Change-Id: Ib229c6d190e1c5d849ea18798925965b8dbeef7e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
It allows for more natural looking generated code and there is no
downside. The arguments are specially prepared for the call anyway.
Change-Id: I8437e93adb1c67db1b53fbdb29cbea10f6ef278f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
metaTypeFromJS expects to assign the value using regular operator=. That
destructs the old value and therefore the old value has to exist.
Change-Id: Ife443b184c30d658f42b65c6717e80685f6635d5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Instead operate directly on the meta object.
We could maybe have an optimization, where we have a global map
from id to QQmlPropertyData for each value type.
Task-number: QTBUG-88765
Change-Id: I259a06ba116a536b56380c2636737c6c016665d9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
It's not being used anymore.
Original-patch-by: Lars Knoll <lars.knoll@qt.io>
Task-number: QTBUG-88765
Change-Id: Ieab1cba6c664c65d123d8f1ffd6db5878010f965
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
With this approach we can also avoid passing the property cache around.
Original-patch-by: Lars Knoll <lars.knoll@qt.io>
Task-number: QTBUG-82931
Change-Id: I88f770d5d9a31b2f5071ad457d9a830900130a85
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't want to convert back and forth between QMetaTypes and ids. This
change is the first step towards using QMetaType directly everywhere.
By reordering the members of QQmlPropertyData to avoid a gap caused by
alignment, we can replace the typeid int with a QMetaType without
requiring more space.
There are still a few places left using metatype ids, notably the value
type logic.
Task-number: QTBUG-82931
Change-Id: Ic38f38d10c71ed20655877976c9cb5ee3cbe2d77
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
This can easily be folded into it's parent classes.
Task-number: QTBUG-82931
Change-Id: I92e490b35c29aacdff3557d0b6318b1dd43e7bbc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
Instead use the proper private API from Qt Core.
Task-number: QTBUG-82931
Change-Id: Ia460350941f07ff749013fb29621460074d57a7d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
Those should not be executed then.
Change-Id: I80bc4b2da0bc0e5813ba4eef4b756065d48ac586
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Property pointer p needs to be checked for nullptr value in
QV4::ProxyObject::virtualGetOwnProperty(). This can happen when calling
hasOwnProperty() or propertyIsEnumerable().
Fixes: QTBUG-88786
Pick-to: 6.0 5.15
Change-Id: I43da58fed4d8656f9187213f7317f17398739e34
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
Apparently that's not a good idea.
Change-Id: Ic49f6d40135f65e39725acd7a745d17917b64be3
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I2340f4413ae9a44c71000e840a79e904b6a0fec9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
In this case we need to pass a pointer to the return variant itself, not
to its data.
Change-Id: I86e468f106f29e1f1be8adee9882d465fd6da533
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This is a single char16_t, not an array of them.
Pick-to: 5.15
Change-Id: I55d23ebb5f2abebd43cd4160a75d373706392ddf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Makes no difference in this case, as it's UTC, but is terser and
perhaps slightly clearer.
Change-Id: I7de315def2f45ec4a12d2a682e5d1d7a4d0a3e6d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
You get to write QML_SEQUENTIAL_CONTAINER(value_type) now, and
qmltyperegistrar will generate a sensible registration call from that.
A registration might look like this:
struct MyStringListForeign
{
Q_GADGET
QML_ANONYMOUS
QML_SEQUENTIAL_CONTAINER(QString)
QML_FOREIGN(MyStringList)
QML_ADDED_IN_VERSION(3, 1)
};
It's unfortunate that we need to use a metaobject to transfer all of
this information, but there is no other sensible way.
Transform the containers defined in qv4sequenceobject.cpp to use the new
style, and move them out of the builtins, into QtQml. Recognize that
only one of them was ever tested, and add tests for the rest.
Task-number: QTBUG-82443
Change-Id: I3a30f9e27266bb575eea26c5daf5dad1ec461cc5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Assigning a plain char to QChar is deprecated. What we want here is the
special Null character, though.
Change-Id: I0f3cd56c8820fdf5afa40cf608e738e04163680a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Quite obviously, the Qt object is a singleton, extended with a
namespace, backed by a member of the JavaScript global object.
Defining all the methods as JavaScript functions is unnecessary and
duplicates the general type transformation code. Also, it makes it
hard to use those same methods from a C++ context as we cannot
properly set up the arguments outside the JS engine.
Rewriting the Qt object reveals some deficiencies in the old
implementation that we need to fix now:
1. The enums of the Qt type were listed as properties of the Qt object,
which means you could iterate them with a for..in loop in in JavaScript.
This is just wrong. Enums are not properties. This functionality
is deleted and the test adapted to check for each enum value separately.
The commit message for the change that introduced the iterability
already mentioned that the author had failed to find any occurrence of
this in the real world.
2. Parsing time objects from strings was done by parsing the string as a
date/time and then picking the time from that. We still support that for
now, but output a (categorized) warning. Parsing the time directly is
preferred where possible.
3. Previously you could create (invalid) dates and times from various
kinds of QML types, like int and color. This does not work anymore as we
now validate the types before calling the functions.
4. Passing more arguments to a function than the function accepted was
unconditionally ignored before. Now, a Q_CLASSINFO on the surrounding
class can specify that the arguments should be checked, in which case a
JavaScript error is thrown if too many arguments are passed. In order
for this to work correctly we also have to ignore JS undefined values as
trailing arguments for overload resolution. This way, if a method
matching the defined arguments exists, it will be preferred over a
method that matches the full argument count, but possibly cannot accept
undefined as parameter.
Consequently a number of error messages change, which is reflected in
the qqmlqt test.
[ChangeLog][QtQMl][Important Behavior Changes] You can not iterate the
enumerations of the Qt object in JavaScript anymore. This does not work
with any other enumeration type either. You can of course still access
them by name, for example as Qt.LeftButton or similar.
[ChangeLog][QtQMl][Important Behavior Changes] The time formatting
functions of the Qt object in QML now allow you to pass an actual time
string, rather than a date/time string as argument. Passing a date/time
string results in a warning now.
[ChangeLog][QtQml][Important Behavior Changes] Functions in the Qt
object for formatting date and time will now throw a JavaScript error
when presented with a value of an incompatible type, such as int or
color.
[ChangeLog][QtQml][Important Behavior Changes] The Qt.resolvedUrl()
function now returns a URL rather than a string. This follows the
documentation.
[ChangeLog][QtQml][Important Behavior Changes] The GlobalColor enum of
the Qt namespace is not exposed to QML anymore. It did not make any
sense before as the enum values could not be used as colors.
Change-Id: I7fc2f24377eb2fde8f63a1ffac5548d652de7b12
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Idb26e2df6d4fe8940db57066a30fa8c243f6d2c9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
|
|
| |
gcc warns (and subsequently errors out) that startTime and function
might be used uninitialized. Use member initialization for all members.
Change-Id: I382c0f78c67fa76f9fc955691f4391a3885da455
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
A QV4Sequence can be converted back to its underlying container; we
therefore should give the conversion of QV4Sequence to container a high
score if metaTypeForSequence and the target metatype agree.
This has a larger effect in Qt 6 than in Qt 5, as we now can have new
sequence types for any (QMeta)Container.
Fixes: QTBUG-87616
Change-Id: I2bf02ebadbf9b707719d09edaf14b112eb2caf4f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
| |
Since we depend on C++17 now, all of these can go.
Change-Id: I0484fd4bb99e4367ec211c29146c316453729959
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a regression from Qt 5 to Qt 6, because QDateTime is now
apparently more strict in its parsing of RFC2822Date. The string in the
test-case is not valid according to that spec, but JS engines like V8
still accept it, and so did we in Qt 5.
Fixes: QTBUG-87610
Change-Id: I2c6eb2087e4845b04fa0dc4f7aa9a229b3428a43
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
We only want the function if it's not a nullptr and if it matches the
required index.
Change-Id: I5695bfb950f66e5a7589b042c3313297c51533d2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This avoids the template explosion and makes the mechanism extendable.
You can now register additional anonymous sequential containers.
Fixes: QTBUG-71574
Task-number: QTBUG-82443
Change-Id: I5b9ed9af1533a3b7df8fc5bb37bbb73b8304e592
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|