[SailfishDevel] Persistently storing a ListModel

Andrey Kozhevnikov coderusinbox at gmail.com
Tue Nov 1 19:46:53 UTC 2016


you storing pointer to model, not model contents :)
to store model data you should recursively convert model data to array, 
and vise versa.

------ Исходное сообщение ------
От: "Marcin Mielniczuk" <marmistrzmar at gmail.com>
Кому: "Sailfish OS Developers" <devel at lists.sailfishos.org>
Отправлено: 01.11.2016 22:32:57
Тема: [SailfishDevel] Persistently storing a ListModel

>Hi,
>
>I'm currently using org.nemomobile.configuration to store the
>application settings. Now it came out it'd be beneficial to store a
>ListModel between runs (if a user wants it).
>
>I tried the naive approach:
>
>     property ListModel myModel: modelStorage.value
>
>     ConfigurationValue {
>         id: modelStorage
>         key: Constants.modelStorageKey
>         defaultValue: ListModel {}
>     }
>
>But no dconf key seems to be generated after I populate the model.
>
>What is my best bet in this case? Is this the expected behavior or have
>I done something wrong on my side?
>
>--
>Marcin
>
>
>_______________________________________________
>SailfishOS.org Devel mailing list
>To unsubscribe, please send a mail to 
>devel-unsubscribe at lists.sailfishos.org



More information about the Devel mailing list