| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a private version of qmlExtendedObject() that returns an
index-based extension (where 0 represents an extension on the leaf type
and N represents a (N - 1)th base type's extension)
Teach QQmlProxyMetaObject to distinguish different extension proxies.
Its custom metaCall can now query up to 128 extensions (should be enough
for the user needs)
Change-Id: I5520a1e84501f1f9fe6a8e77d8269009a12c255c
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise the AOT-compiled code will assume the capture succeeded and
fail to get notified when the value changes. This went unnoticed because
it only applies to direct mode, the tests for which live in a separate
repository.
Fixes: QTBUG-102022
Change-Id: I23d94ccbef5b00c4c6837c88970a4e40b05a912a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d52e1d609516d0573bea1acf2d73d811ff25f0e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
|
|
|
|
|
|
| |
Change-Id: I28bc1c177cb78d85d844c7a5cd5b6710db8fd65d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
There was a condition missing in qqml.cpp making most type lookups crash
right away. Furthermore, we need to generate code for type lookups we do
need. Finally, the shadow check should skip instructions we don't need
anymore. Shadowing in optimized-out code is not very interesting.
Pick-to: 6.2 6.3 6.3.0
Change-Id: I34e9de7686528b39a35e59c616e4e28b32a6e031
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
You really should not mess with that after creating the property cache.
Change-Id: I070200772475bb67f539dbbd85a298020b14ca79
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Revisions before QML_ADDED_IN_VERSION and revisions after
QML_REMOVED_IN_VERSION should both result in anonymous types. This way,
you can then derive from the type in question and expose the derived
type in a different set of versions.
Pick-to: 6.3
Change-Id: Ia59258047fc242c809c27525bb75fd2797fe5aab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we are dealing with dynamic metaobjects, the QML engine may not
create property caches. We cannot see this at compile time. Therefore,
we need to establish a fallback infrastructure that does the same
operations on plain QMetaObject.
Pick-to: 6.2 6.3
Fixes: QTBUG-101349
Change-Id: I8c936fc077b0018df71196620b6987825253cb39
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We register QList<T> as sequential container type for any value type T
we get. This way we can always find a type to use for list<t> with t
being a value type. The metatypes are shuffled around so that we have an
easier time associating a type with its list and vice versa.
As QQmlPropertyData's isQList flag denotes both QQmlListProperty<T> and
QList<T> now, we need to use QMetaType::IsQmlList more often.
Conversely, any name given to extra sequential containers registered via
QML_SEQUENTIAL_CONTAINER is explicitly ignored now. As you can do
list<foo> for any type foo now, there is not much of a point in having
further named container registrations for the same type. It would just
make things more complicated. Mind that the name had already been
ignored before, just not explicitly.
[ChangeLog][QtQml] You can now use lists of value types in QML. For
example a property of type list<int> will hold a list of integers.
Task-number: QTBUG-82443
Change-Id: I7bee61cee3963dae5d231bf59f70b8012984371d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
That's where the data resides. This allows us to lock the mutex only
once for all those methods, and it makes a large number of engine
pointers unnecessary.
Finally, we can now find the element type of a QQmlListProperty without
supplying an engine.
Change-Id: If1ae8eafe8762a112d1ca06f9c92ab8a727d1bda
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
It is just in line with the other propertyCache() methods, and should be
treated the same way. The comment made no sense anymore. This allows us
to drop more engine pointers.
Change-Id: I2e9b479b555c7f771b619e4693d59cbfcf244df6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It leads to data corruption. Also, be more careful about releasing the
property cache. We can only do that if the qobjectlookup member of the
union is active. Unfortunately we have to do a number of checks now, to
make sure it is. In order to still keep the checks inline, we move some
functions around.
Pick-to: 6.2 6.3
Fixes: QTBUG-99211
Change-Id: If6dd879e67b172e1a9035e83fbfacbe73c6c7476
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This avoids duplicate evaluation and binding loops.
Pick-to: 6.2
Change-Id: I5eba42d9dca0782dd964bd64c088c2e158faa9b3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a function that performs a lookup is called recursively via the
flushing of initial bindings, we may initialize the same lookup twice.
In that case, make sure to release the old property cache before
overwriting it.
We might suspect that this can only re-assign the same property cache
again and therefore we can skip the whole operation if it has been done
before. Yet, considering the dynamic nature of QML, it's very hard to
guarantee this. There are cases where we have to revert lookups because
the types don't match anymore at the time we call them again. I cannot
rule out the possibility of this happening during initialization.
Therefore, the code doesn't try to be clever about this case and instead
just blindly overwrites the lookup (like it did before, just without
leaking).
Fixes: QTBUG-99025
Pick-to: 5.15 6.2
Change-Id: I536deef282bbff723f79a82e4d9e694c3d2d32df
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we pass in a const pointer, we're not allowed to modify the object,
so the create==true case does not make sense there. We therefore provide
now two versions of the function: One taking only a const pointer, and
one taking a non-const pointer and a bool. The latter no longer provides
a default parameter to encourage usage of the the const version wherever
possible.
Change-Id: Ifb5a7e0605127de429403982b31f754e154b8048
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Otherwise we cannot find attached types of the same name as the current
document.
Pick-to: 6.2
Change-Id: I927c49d30e466109cc1ef0c1439435581ee30a53
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We generally want to use QQmlRefPointer for it, rather than manually
calling addref() and release() all over the place. Also, we can
completely inline its ctor and drop an unused member.
Also, do not keep property caches of dynamic meta objects in type
registry. The dynamic metaobjects will change, and the outdated
property caches will eventually be retrieved.
Change-Id: I8042c85b32f3031b554f97a35c1545a3412d2acb
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This is necessary in order to expose all revisioned properties of foreign base classes regardless of module version.
In some instances we will want to follow Qt versioning instead though and only expose those classes that are actually
exposed at that version level. This will be handled by a follow up change.
Fixes: QTBUG-91706
Change-Id: I9049d5cada812560a4b9e07874954045ee5d5562
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
This allows us to discern between instances and types in some more
cases. Also, we can provide a lookup mechanism to support the same thing
in generated code, now.
Change-Id: I9d52036a5d2eb11f214f43f976242f43f8f82358
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This is faster than creating a QJSValue from the global object itself
and querying that one.
Change-Id: I0cc55103f96019ebbf91b683745d51416da9a3ad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QQmlFinalizerHook is meant to replace registerFinalizeCallback. The
latter is more powerful: It allows you to register multiple functions,
depending on various conditions. Moreover, if the component is already
finalized, it directly runs the function.
However, that power is not used anywhere: All we currently use and need
is the ability to run a function after the component is finalized. By
using an inerface instead of some generic registration framework, we can
make finalizers visible to tooling. This is especially important for
qmltc, which needs to instantiate the compiled components and still must
ensure that finalizers do run.
We also use this chance to document the existence of finalizers, as well
as the difference between componentComplete and finalizers. The
interface is kept internal, as asynchronus component instantiation is
still an underdocumented corner of the QML engine, and the implications
of making the interface public are unclear.
Task-number: QTBUG-96054
Change-Id: I876bf9650faac20598cfd6aaea7c6da9bf65d73f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
That's part of the sloppiness. We have no way of retrieving the lookup
metatype here.
Pick-to: 6.2
Task-number: QTBUG-96144
Change-Id: Ibd1c0d8e9bb66bfe66e59fd1368f3f8ac663d01c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We want the same init/apply mechanics to also work with setObjectLookup,
and for that we need lookupResultMetaType to do the same thing there.
Task-number: QTBUG-96144
Pick-to: 6.2
Change-Id: I410101b7f13e60c0c2ed156a8cf5813c490d7bf0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
This is handy for cases where you want to clearComponentCache().
Singletons may hold on to old types, and using them after
clearComponentCache() can produce surprising results.
Task-number: QTBUG-95788
Change-Id: I390ff78cf9be9c034573ae848c8ccefa6d6a8817
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
The code generator needs to see the modulePrefix as a separate step in
order to generate sensible code. The savedPrefix we had before was not
exposed to the code generator. As an added benefit we can also check
that we don't refer to singletons as properties of objects this way.
Task-number: QTBUG-95822
Change-Id: Ia8992dba340bf0552e7647f0d66b441f1ac1b8c8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
It is shorter and encapsulates the exception handling a bit.
Change-Id: I8e2dc0eb3b930e222b8cb4852b73d99ca18a0379
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
undefined as value returned from bindings has the special meaning of
resetting the binding. As AOT-compiled functions return the actual type
of the binding rather than a QV4::Value, we cannot always encode
undefined. Therefore, add a flag that tells us whether the result was
supposed to be undefined.
Pick-to: 6.2
Change-Id: Iac2298869dde80f6d889240dd8200b2ad83e5dc5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
We cannot use the lookup metatype before we initialize it, and the
calling code cannot know the result metatype before the lookup is
initialized, either.
Pick-to: 6.2
Change-Id: I3c691b41dbdb416aa1822c0ea7c4b887398f7908
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Apparently we can still call bindings and functions on those. In
contrast to the QML engine, we throw a type error here, rather than
silently returning undefined.
Pick-to: 6.2
Change-Id: I7d7daf1582d891f6acadb705b50dc36e23f8425c
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Otherwise we trigger asserts in various places. We also need to generate
exceptions matching those the interpreter generates, and we need to
decline capturing of nullptr objects.
Pick-to: 6.2
Change-Id: I65744fa3e440939db28d7b16a044f6968500a67b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
If we call an AOT-compiled function we never need the JavaScript call
frame. We can just skip its setup and save some overhead.
Change-Id: I39dc2ca6eea5b5a66f3b87b642a310534cecf6cd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This saves us some ping-pong between the IDs and the QMetaTypes, and
avoids possible ambiguities if multiple metatypes are registered for the
same C++ type.
Change-Id: I81cec94a9cd05d69927dc884f65574f0ab2ddc22
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Currently internal, as the only user might be qtcharts.
Change-Id: I40fc5295de6375c082d82ebeeb73bf4cd6dc7e4a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
As long as the lookup isn't initialized, we cannot get its result type.
If the AOT code relies on the result type to be retrieved from the
lookup, allow an invalid type to be passed to the initialization
function.
Change-Id: I36a1dbe316010dc466a28bae65c3ed267588fc29
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
We often use QQmlListProperty<QObject> as generic type for any list
property. This is somewhat dangerous, but unavoidable for now.
Change-Id: I9eba2829eaa84aaffe193365f46f406c30fdbf69
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
The AOT compiled code may be unable to express the true type.
Change-Id: Id6a0b0c107aa5f05f6024817a1fdea5179ddf5ca
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The object to be used for the lookup can be different from what the
caller expects. We need to verify that the caller talks about the same
type as the object. If it doesn't, throw an exception.
For the same reason, also throw an exception rather than asserting if
the property caches don't match.
Change-Id: I3b45691bfe2204820d878a624814d412d1358c24
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
If we know that a property is final, we don't have to consider
overrides. Therefore, we can accept a derived class as subject of the
lookup. It doesn't have to be the exact same class.
Change-Id: I831c64b661730d78d12cec5c98e39282fc8742d8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Leverage the property cache for efficiency.
Change-Id: I99910d6851aa5c3d58b15094fbc092c157c74368
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Such lookups are usually caused by repeaters or similar constructs where
many objects look up something in their parent context. As all those
objects have different contexts, we would constantly invalidate the cache.
Change-Id: I06c7d337d859e5e6a81f6e9a8693b155b2af7498
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each kind of lookup should come with a function that tries to execute
the lookup, taking a minimal number of parameters, and another one that
initializes the lookup, taking whatever is needed for that. No
initialization should be done in the execution step and vice versa.
Rather, the execution step should be repeated if an initialization had
to be done first.
This way, the happy path can be very fast if the lookups have been
initialized before.
Change-Id: Ic435b3dd4906d00144138cb05161a99a0a9c64ed
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
The caller has to make sure the types match. We only check for QVariant.
Change-Id: I17d08cab650f9f4d467fa61e2f285f045b73ba0c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I4acfce1571bfb2527d2ede43229957b89230022e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We can shortcut some of the lookups if we know what we're looking for.
Also, as the lookups are populated from the same code that calls them
later, we can drop the sanity checks. The calling code should know what
it does.
Change-Id: Iae3a5b0e997aa5a90bea7933e7ce1f2415f5299b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Ie06b029850b74e98d6d6e38b480cedef4e481691
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
If we already know the property cache and data we don't have to look
them up again in captureProperty(). Such lookups can be expensive.
Change-Id: I94553260311912c5acee3105295f124721203e01
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
We only ever need it to retrieve the QQmlEngine. However, resolving the
context can involve an allocation.
Change-Id: I064fd528fa7ab9bd37043c5dd1c62d17ea9380e3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The method already returns a bool status which tells the caller
"something is wrong". If something is wrong, the caller will try a
different method to retrieve the value, and that will generate the
exception again. We should not shortcut the procedure as generating the
exception requires the instruction pointer to be set, which is
additional overhead on the caller's side.
Change-Id: Ia2d3a90c897b14660a18a5740498a0e5016dc49a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Getting a property of an object and getting an object by ID should not
require any type transformations.
Change-Id: I7ba06cf7c09cdf4ce7b0093b670fd7879ecf799a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This is useful when we know how to read the property directly.
Change-Id: Ibc314a8e8bf9e51b3a15d934f6a1f17a53ea168a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|