[SailfishDevel] Wrap data in Item to get notifiable properties ?
François K.
daitheflu at free.fr
Wed Dec 3 11:05:37 UTC 2014
Hi,
Sorry to bump this, but I think my last mail formatting was misleading.
It actually contained another question :
> The best way to do this is to use QML ListModel. Instead of loading
> the properties in a JS object, you can load them as model properties
> (via
> http://qt-project.org/doc/qt-5/qml-qtqml-models-listmodel.html#set-method).
> Accessing the properties would be done via "model":
I see. Since I already have a ListModel for the previous view (basically, a list), I'm now wondering if I'd best :
1. Load everything in the ListModel and just go on with it (but what about memory consumption if the ListModel is big ?) ;
or :
2. Load the minimum amount of data in the ListModel for the ListView, and when I enter the DetailsView, load the additional data and modify the ListModel via set(...) or setProperty(...).
Or is there a (third) better way ?
> If you don't want to use a ListModel, prefer using QtObject instead
> of Item. QtObject provides a non-graphical component to store
> properties, unlike Item that implies having a "box" (x, y, width,
> height, anchors etc.)
Oh yes, sure ! How could I miss that one ? :(
I think I'll try to stick with the ListModel, it'll probably solve another issue :)
Best regards,
--
François
More information about the Devel
mailing list