Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Multiple property change events in the same time ?
Forum Updated to NodeBB v4.3 + New Features

Multiple property change events in the same time ?

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • AlicemirrorA Offline
    AlicemirrorA Offline
    Alicemirror
    wrote on last edited by
    #1

    Hi to all,

    If I have a property that needs some trick when the value changes i.e. saving its new value somewhere the most reliable thing to do is to manage the assignement in a onPropertyChange: event.

    What happens when I have 5 or 10 properties that should be managed? What I am asking is if there is a way to manage a single event including multiple properties so when at least one of these changes the event is fired and I can manage the changes as the program logic need.

    The actual simple solution that I have found is to chain a couple of events in the following way:
    @
    // Set a global signal
    signal somethingChangeProp

    // Set the default values for the properties
    property string valueA: "aaa"
    property string valueB: "bbb"
    property string valueC: "ccc"

    // When a property changes always the same signal is called
    onValueAChanged: somethingChangeProp()
    onValueBChanged: somethingChangeProp()
    onValueCChanged: somethingChangeProp()

    onSomethingChangeProp: {
    // js code to manage the values of the three properties, save them etc.
    }
    @

    Is there a more efficient method ?

    Enrico Miglino (aka Alicemirror)
    Balearic Dynamics
    Islas Baleares, Ibiza (Spain)
    www.balearicdynamics.com

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved