[Interest] getting type information of properties in QML
Ulf Hermann
ulf.hermann at qt.io
Mon Aug 5 12:59:21 CEST 2024
> 1) value types are always copied
Sort of. Most value types still look like JavaScript objects which are
passed by reference. Internally, the reference nature is simulated by
copying the data into a local and two-way-synchronizing with the
original. This becomes expensive if either side changes often and/or the
type has a lot of data.
> 3) types like int are not value types so they have to be treated
> differently in your case. However, Number.isInteger(n) may get you close.
Numbers are still value types. What makes them special is that they are
not objects in JavaScript and therefore not passed as reference. And you
can also not use instanceOf on non-objects.
best regards,
Ulf
More information about the Interest
mailing list