[SailfishDevel] ConfigurationValue default path

joao morgado joaodeusmorgado at yahoo.com
Mon May 21 10:13:36 UTC 2018


 Ok, got it working, thank you.
But since I want this to be as portable as possible (I manage to make one repo for sailfish and android), I would rather use Settings from Qt.labs.settings 1.0, wich doenst seem to be available in sailfish. 
I'm thinking on creating a class based on QSettings and export it to qml. Or do you guys have any other aproach/sugestion ?
ThanksJoão    Em segunda-feira, 21 de maio de 2018 08:07:46 GMT+1, Pekka Vuorela <pekka.vuorela at jolla.com> escreveu:  
 
 On Mon, 2018-05-21 at 04:45 +0000, joao morgado via Devel wrote:
> Hi Martin
> 
> Thanks for your replay. 
> I did a very small example, trying to save a rectangle color, but if
> fails. When starting, it's always red. Am I missing something ?
> 
>    
>    ConfigurationValue {
>        id: mysettings
>        property alias saveColor: mycolor.color
>        property alias mystring: page.hello
>        //property color saveColor: "red"
>    }
> 

You should have a key there to indicate what configuration value should
be accessed. And value is referenced with 'value' property.

ConfigurationValue {
    id: mysettings
    key: "/path/in/the/dconf/hierarchy/some_option" 
}

Component.onCompleted: console.log("Value: ", mysettings.value)

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20180521/184fab3e/attachment.html>


More information about the Devel mailing list