Unsolved Does really property var mdl: model copies the full model object in memory?
I faced with this issue that I have to pass forward some data from one QML component to another and thus I created
property var mdl: modelwhen
modelhere is quite heavy object.
Does QtQuick really copies this in memory or how does it works? and what is the difference with
p3c0 Moderators last edited by p3c0
It is documented here. From the doc:
Property aliases are properties which hold a reference to another property. Unlike an ordinary property definition, which allocates a new, unique storage space for the property, a property alias connects the newly declared property (called the aliasing property) as a direct reference to an existing property (the aliased property).
So what I understand from it is that the first assignment (in your example) will copy into a new object while aliases holds the reference.
modelin example is a model defined in C++ and instantiated in QML.
The question is
Does QML makes copy of this object (2 data models in memory) or it keeps only reference.
is it ducumented somewhere?
A Former User last edited by
@Kofr Hi! If you want to be really sure (because you don't trust the docs or your code ^_^) then add something like
qDebug() << "hello";to the destructor of the model and see how often that's called.