| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most FunctionObjects do not actually need their custom jsCall members.
They will only call the functions from the vtable anyway. FunctionObject
can therefore be split into a static and a dynamic variant. Only the
dyanmic variant needs to carry (and invoke) the extra pointer. The
jsCallWithMetaTypes pointer is completely pointless because none of the
dynamic functions actually implement it.
Furthermore, the QV4::Function and QV4::ExecutionContext pointers in
FunctionObject are only needed by actual JavaScript functions. The
builtins that like to be dynamic functions never need them. Therefore,
split out another class for this.
In the generic FunctionObject, we need the capability to decide at run
time whether the function shall be a constructor or not. Add a flag to
replace the check for jsCallAsConstructor.
Also, where we can, avoid the pessimization of checking whether a
function is a constructor before trying to call it as constructor.
Rather have the default implementation throw the exception.
As a side effect, for most functions we don't need an ExecutionContext
anymore. The engine is enough.
Task-number: QTBUG-124662
Change-Id: Iac657fa71288dd6ec230a33de2986ba3bcf4628c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lookups can (and do) reference HeapItems. This was safe in a
non-incremental gc world, as Lookups are always reachable via their
containing CompilationUnits, which are part of the root set. However,
when using an incremental gc, an already marked Lookup might reference a
new heap item, which then becomes otherwise unreachable.
This is alleviated by the fact that Lookups generally either refer to
something already existing or a freshly allocated string. The latter
however is only safe when we can rely on black allocations during gc,
and the former is somewhat reckless.
Remedy this by employing the WriteBarrier for Lookups. We wrap all
HeapItems in a helper class, which -while trivial itself- can't be used
for direct assignments. Intead, it employs a set method which ensures
that the WriteBarrier is used.
Task-number: QTBUG-121910
Change-Id: I6a0ede66ad044076d2e87f134bc95686cb586aee
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want to be accessible to qmllint and other QML tooling. To this end,
make all legal invocations of its methods properly typed invokables.
Keep two QQmlV4Function overloads to produce error messages if the
methods are called with the wrong parameters. We have to do this because
JavaScript is more liberal in its argument coercion than the methods
would like.
Un-deprecate QJSNumberCoercion::isInteger() since it's actually quite
practical here.
Pick-to: 6.7
Fixes: QTBUG-112366
Change-Id: I016e5edc47efaade44461c504c1b3e2b1b829b58
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
That's a rather common thing to do.
Change-Id: I259848b9be5e2a578b0fc1c5f4c6f0f61bd3b723
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Retrieving the QQmlValueType is expensive and there is not a single
place where we need anything but its QMetaObject. Retrieving only the
meta object, on the other hand, is cheap.
Change-Id: I3ad5574d64f1f67a4d4cf2886dc5c396e99ec91a
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our value type refactoring in 6.5 broke reset support for value types
when that write happens through virtualPut.
Fix that by checking whether the value we're assinging is undefined
before attempting any conversion, and reset the gadget in that case (if
it is actually resettable).
Task-number: QTBUG-113473
Pick-to: 6.5
Change-Id: Ifaa2d045f718fc3cb2d5e75b3626b41175ac3a3b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The new overload avoids the unconditional deep copy inside
QMetaProperty::write()'s lvalue overload.
Task-number: QTBUG-112762
Change-Id: Ic224faf72288e73bb6ad9049f1e0dc585e04ca19
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Task-number: QTBUG-112180
Done-with: Fabian Kosmale <fabian.kosmale@qt.io>
Change-Id: I48a2a696d3424ab1d8b9e693a92361a978ad70e9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
They should either be the same size as int/uint or the same size as
longlong/ulonglong, but for some reason we get them as separate types.
Pick-to: 6.5
Fixes: QTBUG-110767
Change-Id: I4c5826cfe6108e6f9722e6b3443bde13b2141b04
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a property is changed and reverted in short order, any animation
attached to it may not get a chance to take effect in between. In such a
case it looks like we don't have to update the interceptor when
reverting, but we actually have to. The animation needs to be canceled,
after all.
We now have to fix the case of writing different properties of a value
type sequentially, where one has an animation attached to it, though. If
that happens, we cannot drop the animation when a _different_ property
is written later on, but we do still have to update the whole value
type. So, pass an additional argument in the relevant metacalls that
declares the property we intended to change.
Pick-to: 6.5
Fixes: QTBUG-54860
Change-Id: I3b6cad2d4707d30312cda98283928fd419c40345
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
| |
A JavaScript Date object can be backed by QDate, QTime or QDateTime.
Allow those to be written back.
Pick-to: 6.5
Fixes: QTBUG-28981
Change-Id: Ic46b5c4daf75453f03e99470933cf179820e63ef
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
| |
QTimeZone now packages Qt::TimeSpec details, unifying QDateTime APIs.
Task-number: QTBUG-108199
Change-Id: I4a6bfaa213ec6db2fb357d20c7cd59e8c58ad103
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need two metaobjects: One with the PropertyAccessInStaticMetaCall
flagg and one without. The one without needs to be used with
QQmlGadgetPtrWrapper, since the wrapper wants to intercept metacalls.
The other one needs to be used when calling readOnGadget(). We can
accommodate this by just retaining the original metaobject. As it's
retrieved from a gadget type you should definitely be able to
readOnGadget() with it. The dynamic meta object, on the other hand, can
be lazily created when we actually metacall() through
QQmlGadgetPtrWrapper.
This relieves us of all the special casing around QQmlGadgetPtrWrapper
and makes it safe to use for anyone.
Fixes: QTBUG-108704
Change-Id: Icc01c81babaa9d1eca8d5ddfaf44d724a404db38
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Both types have functionality to write themselves back to the properties
they were loaded from on change, but so far we could not nest those
writes.
[ChangeLog][QtQml] You can now assign to properties of nested value
types and to elements of containers from QML functions. You cannot,
however, take references of such values and elements. This is in
contrast to non-nested value types and the containers themselves.
However, passing references of value types and containers around
generally leads to very confusing effects. Don't do this.
Fixes: QTBUG-99766
Change-Id: I74cb89e5c3d733b0b61e42969d617b2ecc1562f4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
With this in place we can enforce that reference objects we add in the
future can only be written back in the same statement as they were
created.
Task-number: QTBUG-99766
Change-Id: I1c74bd239caa1bb5febd1a3705d8ee29a8fc4249
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Every QQmlValueTypeWrapper is potentially a reference now. Since most
were already before, the overhead of checking the vtables at every step
was dubious at best.
Extract a common base class that handles the reading and writing of
object properties employed in both value type references and sequences.
Task-number: QTBUG-99766
Change-Id: Idf72d9a20a52366e5c2d0dcd4b3a18072c0ccc41
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
The data needs to be copied anyway if we are going to store it in
ScarceResourceObject. We can just as well copy it from the void pointer.
Change-Id: Ic106221138b1236a6ddea20cfdb468c6fbe3e1c3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When loading from value type properties we left quite a few trivial
conversions on the table and went via QVariant instead. Add them.
It would be nice to unify the various places where we switch over the
trivial types, but I don't see an easy way to do so right now.
Change-Id: I9dcb29ce147a2f282e7ea6903a7af8a4b3038af6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far, for each method call we had to allocate a new QObjectMethod as
we didn't have any lookup to cache the methods. Introduce a new lookup
for that and use it for all QObject methods.
Since QObjectMethod contains a pointer to the concrete QObject the
method was retrieved from, some more care has to be taken: If we are
going to call the method right away, we don't need the object since we
always have a thisObject and any further retrieval of the same method
will result in a call again. This enables us to cache the method for any
instance of the same class. When storing the method elsewhere, though,
we need to hold on to the object since you can defer the call or connect
a handler to a signal or similar. For such operations we do need the
object. We can still optimize a bit by re-using the method cache we
build the first time around.
Fixes: QTBUG-95628
Change-Id: I5991180c5e0234cdc179c2b78a43dafc9083e525
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Wherever we need an engine in there, we also have a managed value to get
it from. This relieves us from the requirement to drag an engine around
wherever we want to call toVariant().
Change-Id: Ib95d02b5fbf5eaa494214e337c9b700e97e5e0df
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
We do not have to use the generic path, given that we can just query the
meta-object for the existence of the property.
Task-number: QTBUG-104803
Change-Id: I9c4f7f8752e0cd8cfd63189538d6ca42523b3587
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Otherwise we may end up with a nullptr gadget.
Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-104803
Change-Id: Ia0c3741fdf0214f0c3d4b352006442747f635f5c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
Those should be more efficient and make your feet attract fewer
projectiles.
Fixes: QTBUG-103588
Change-Id: I8b25b9edb1edf5e112dbcba5bba898646d29ae2b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Instead of a bool we can just return an enum of the actual kind. This
way all the checks become more readable. Furthermore, we can eliminate a
dynamic_cast without sacrificing readability.
Change-Id: I8a38687f9b796cd47196a6ab0385624c737e4435
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
It really only works for value types and it's not intended to do
anythign else. The name should reflect this.
Change-Id: Ib73bf7e9655971f7826fe72145e2d2fab363363c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I66a5ef7cf0b7cd6d574b9f0cae6b5e116d4917e8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we call a function on a value type reference we have to assume that
the value has changed. Therefore, we need to write back, just like we do
when writing a property on the reference.
Fixes: QTBUG-91783
Pick-to: 6.1 5.15
Change-Id: I6d2e957997d64e40e42eb5210350b6592a92ee26
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
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>
|
|
|
|
|
|
|
|
|
|
| |
This way, we can avoid the costly id to metatype lookup in case where we
actually need the full metatype.
Task-number: QTBUG-88766
Change-Id: Ibe29b323007f00d2f8d1807fb9b64f9a8f87e807
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We almost never need to construct a QVariant to do this. Constructing a
QVariant is excessively expensive if you have something simple like an
integer. This also fixes the unexpected "unwrapping" of variants when we
pass them through QJSValue.
[ChangeLog][QtQml][Important Behavior Changes] If you create a QJSValue
from a nested QVariant (that is, a QVariant containing another
QVariant), then, when retrieving its contents again, the outer variant
is not unwrapped anymore. Rather, you get exactly the value you've
passed in.
Change-Id: I8c16eed4f13e8cfdeced0756eef593b3b8e84dd1
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
You can wrap QObject pointers in plain JavaScript.
Change-Id: I246a72a7d5d7b2562e722bf9eafc7880b772a806
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I8f4b2703fdd08ff341904219cec33c321e0511c7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
The internal QVariant constructor taking a QMetaTypeId has been removed.
Thus, construct QMetaTypes where necessary from the id, or avoid a
QMetaType -> ID -> QMetaType roundtrip where we already have a metatype.
Also fix a few missing includse that were previously transitively
included.
Change-Id: I56ce92281d616108a4ff80fe5052b919d1282357
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
QPoint, QPointF, QRect, QRectF,... are basically equivalent in QML JS
where int and double are stored as double, but QVariant now has a
stricter equality comparison, which breaks code.
Make QQmlValueTypeWrapper::isEqual perform the weaker comparison.
This fixes a regression in tst_qqmlvaluetypes and
tst_qqmlvaluetypeproviders which blocked CI.
Change-Id: I0fe1cab17092190ff6cf2a01310943d72d932073
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Fixes crash observed in I50bd32557c55dddcb197f163609fd7d5a1b2301b
Change-Id: I93f580dbdf5f6d4fe0ad87f4a8a4080421872e4a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
QMetaType::convert() is notoriously hard to use. You cannot keep the
QString on the stack as QString because its dtor will unconditionally be
called when the scope is left, no matter if the conversion succeeded.
Therefore, keep an array of quint8 on the stack and manually call the
dtor if the conversion succeeds.
Change-Id: If7970ff6adb4cc2a822a065f9f07130065ce9502
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| | |
Change-Id: I9f0d5adf1ba7d3246b1107a20d145e7aac2c7a77
|
| |
| |
| |
| |
| |
| |
| |
| | |
The type names are expected to be UTF-8 and we don't need to keep
temporary meta types.
Change-Id: I676d04d8733ef0ea3e159038d4973753350572bf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This class is not a private detail of QQmlContext. And it is incredibly
hard to see who owns what in there. Let's add some civilization ...
We enforce refcounting for QQmlContextData across the code base, with
two exceptions:
1. QQmlContextPrivate may or may not own its QQmlContextData.
2. We may request a QQmlContextData owned by its parent QQmlContextData.
For these two cases we keep flags in QQmlContextData and when the
respective field (m_parent or m_publicContext) is reset, we release()
once.
Furthermore, QQmlContextData and QQmlGuardedContextData are moved to
their own files, in order to de-spaghettify qqmlcontext_p.h and
qqmlcontext.cpp.
When the QQmlEngine is deleted, any QQmlComponents drop their object
creators now, in order to release any context data held by those.
Before, the context data would be deleted, but the object creators would
retain the dangling pointer.
[ChangeLog][QML][Important Behavior Changes] QQmlContext::baseUrl() does
what the documentation says now: It prefers explicitly set baseUrls over
compilation unit URLs. Only if no baseUrl is set, the CU's URL is
returned. It used to prefer the CU's URL.
Change-Id: Ieeb5dcb07b45d891526191321386d5443b8f5738
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Fixes: QTBUG-82843
Change-Id: I1ea4a52b33e7d318525e63346eab46ecf7a8fec0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
as type is going to be deprecated.
This change was done automatically with the help of clazy.
In addition, ColumnRoleMetadata was changed to take an int instead
of a QVariant::Type
Change-Id: Ibc02d7b52e7d931a56c19fdebc4788b5e6df2a39
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
| |
Change-Id: I8314f2a675211fba08b71e74eacc38076c82b1ed
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: Ic135a863581d29a3afb9c6c7f070d2630b3913b4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/compiler/qqmltypecompiler.cpp
src/qml/compiler/qv4bytecodehandler.cpp
src/qml/compiler/qv4codegen.cpp
src/qml/compiler/qv4compileddata_p.h
src/qml/compiler/qv4compiler.cpp
src/qml/compiler/qv4instr_moth.cpp
src/qml/compiler/qv4instr_moth_p.h
src/qml/jit/qv4baselinejit.cpp
src/qml/jit/qv4baselinejit_p.h
src/qml/jsruntime/qv4function.cpp
src/qml/jsruntime/qv4vme_moth.cpp
Change-Id: I8fb4d6f19677bcec0a4593b250f2eda5ae85e3d2
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The main feature that needs to be implemented in order to enable lookups
in QML files is to respect that the QObject wrapper has its own storage
layer (meta-object properties). Lookups need to be able to index those
when the base is a QObject. This is done by caching the property data
and guarding the validity by comparing property cache pointers.
The same lookup logic is also implemented for value type wrappers.
OVerall there's more that can be done with lookups in meta-objects, for
constant properties for example.
For "global" lookups we have a safeguard in place that generates a
LoadName instruction for property access that should end up in the qml
context wrapper. So no changes are needed here at first, but the lookup
in the QML context can be optimized in the future.
The way of storing the property cache in the lookup itself trades
ugliness on destruction against the creation of less internal classes.
Another option would be to store the property cache in the internal
class and let QObjectWrapper always transition via the property cache.
Task-number: QTBUG-69898
Change-Id: I9c378c071acc6d7d4a34a2a76616f9594119d515
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|