[Interest] How to prevent large qml forms from hitting javascript stack size?
Ulf Hermann
ulf.hermann at qt.io
Mon Sep 11 09:40:30 CEST 2023
> 775k objects, the form is split into smaller pieces mentioned as
> Components to load when needed, but qml engine traverses it all
> completely and reserves full memory seemingly
You don't want 775k objects in memory all at the same time.
You can use the various views (ListView, GridView, ...) to dynamically
load objects as needed rather than pre-loading them all. You can also
use Loader and Instantiator to factor out groups of objects to be loaded
only when enabled.
You can use Repeater to de-duplicate your code and reduce the overhead
of processing huge amounts of it. That would initially help you here,
but it would still result in lots of objects being created after it's
done processing the compilation units. You may still do it for the
internals of your components once you've split them into groups.
best regards,
Ulf Hermann
More information about the Interest
mailing list