Comment 2 for bug 1390643

Revision history for this message
Lars Karlitski (larsu) wrote :

The problem seems to be that the binding (checked: systemSettings.rotationLock) gets destroyed when assigning the value in the click handler. It works if you either explicitly set the value in onChanged of the settings object:

  GSettings {
    id: systemSettings
    schema.id: "com.ubuntu.touch.system"
    onChanged: control.checked = settings.rotationLock
  }

That's a bit ugly, because now the settings object needs to know about all UI elements that depend on it. Alternatively, you can use the Binding element:

  Binding {
    target: control
    property: 'checked'
    value: systemSettings.rotationLock
  }

To be honest, I don't know what the difference between the two ways of binding properties is, but the one with the Binding element works in my test.

(Removing gsettings-qt, as it's not a bug in that)