1

I would like to save the current "value" property of several components (e.g. a Slider) as a configuration profile when the user clicks on the Save button in my application. However, the Save button is in a different file than the rest of the components. How should I deal with this? Some solutions that I have thought:

  1. do a two-way binding between the "value" property of the component and a role in my model (by using Binding)
  2. reference every component by ID, even if they are in different QML files, in the onClicked handler in my Save button and save the data to the model
  3. make onClicked in my Save button to emit a signal that will be "caught" in every QML file, making the components commit their value to my model

Am I on the right track here?

1
  • The way I would go about this in Qt, and subsequently qml, is connect the value signals for when they change, to a global component, syncing those values.
    – Anon
    Feb 10, 2019 at 19:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.