[Interest] QML: Considerations on an interesting design pattern that relies on JS engine's garbage collection

Ulf Hermann ulf.hermann at qt.io
Mon Apr 14 08:29:10 CEST 2025


On 4/11/25 18:05, Fatih Uzunoğlu wrote:
>  > However, if you create a new Component object in every
>  > derived type you probably haven't saved a lot of memory
> 
> Is not this because of the same long-standing issue?

It is indeed the same issue.

Making Component deferred by default still requires some 
default-handling of deferred names. We don't have that yet. We only have 
specialized handling in some places in QtQuick and QtQuick.Controls. If 
we had it, it would probably be a good idea to make it available for any 
kind of property, not only those of type Component.

Furthermore, anything that has an ID is discoverable in derived scopes 
and contexts. Therefore, nothing that has an ID can be deferred. At 
least not in the current setup. Thus, your example would still not work 
if all properties of type Component were deferred by default.

best,
Ulf


More information about the Interest mailing list