qml - Saving JS Object (variant or var) in settings -
when write this:
property bool token: false settings { property alias token: root.token }
and change token
somewhere in application true
, next time when run application token
true
.
but when write this:
property var token: null settings { property alias token: root.token }
and change token {'a': 'b'}
example, next time run application token null
settings
doesn't save js object. idea what's wrong here?
update: seems problem not saving js object {'a': 'b'}
, qml saves successfully, problem null
if change false
works alright. guess it's related question storing data using settings element in qml don't understand why null
being post processed, though using false
instead of null
default value property solves problem don't don't want false
here, it's not appropriate morally, want null
.
update 2: found solution, setting no default value property (not false
nor null
) seems solve issue , seems appropriate morally this:
property var token settings { property alias token: root.token }
i don't understand why null
doesn't work yet. explanation welcome.
setting no default value property (not false
nor null
) seems solve issue:
property var token settings { property alias token: root.token }
Comments
Post a Comment