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?

  • 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. – Akiva Feb 10 at 19:30

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.