Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Signal when changes occur to *data* property

    QML and Qt Quick
    1
    1
    282
    Loading More Posts
    • 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.
    • L
      Larpon last edited by

      Is it possible to get notified when an items data property changes?

      There's a onChildrenChanged signal which works for visual items but I'm looking for the non-visuals

      The following doesn't work:

      import QtQuick 2.0
      
      Item {
          id: modes
      
          Connections {
              target: modes
              onDataChanged: {
                  for(var m in modes.data) {
                      var d = modes.data[m]
                  }
              }
          }
      
          onDataChanged: {
                for(var m in modes.data) {
                    var d = modes.data[m]
                }
          }
      }
      

      Both gives me the error:

      Cannot assign to non-existent property "onDataChanged"
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post