Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QML ApplicationWindow: Binding loop detected for property (multiple variables)
Forum Updated to NodeBB v4.3 + New Features

QML ApplicationWindow: Binding loop detected for property (multiple variables)

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 3.7k 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.
  • S Offline
    S Offline
    shokarta
    wrote on last edited by
    #1

    Hello guys,

    im quite new in QML, but I have done first sport tracking app which seems to be working, however I am having multiple warnings on each screen of binding loop...
    app seems to work quite fine actually.

    As soon as I run the app, I have these errors:
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getCurrentWorkout"
    qrc:/main.qml:69:9: QML Rectangle: StackView has detected conflicting anchors. Transitions may not execute properly.
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getCurrentWorkout"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getCurrentWorkout"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getCurrentWorkoutInput"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getCurrentWorkout"
    qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getCurrentWorkoutInput"

    I am very interesting to learn how to declare and use variables properly!

    link to the project: link text

    If there is any tips from you guys how to improve, would be much appriciated.

    Thank you

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Binding loop is a situation where a property value is updated and that triggers other changes which (eventually) change the initial property again - this would normally lead to an infinite loop and application crash. QML engine stops such recurring bindings, though. That's why your app works normally.

      It's a very good idea to fix these issues, though. Go through your code and see where "getProfile" is modified, what will it lead to etc.

      (Z(:^

      S 1 Reply Last reply
      2
      • sierdzioS sierdzio

        Binding loop is a situation where a property value is updated and that triggers other changes which (eventually) change the initial property again - this would normally lead to an infinite loop and application crash. QML engine stops such recurring bindings, though. That's why your app works normally.

        It's a very good idea to fix these issues, though. Go through your code and see where "getProfile" is modified, what will it lead to etc.

        S Offline
        S Offline
        shokarta
        wrote on last edited by
        #3

        @sierdzio said in QML ApplicationWindow: Binding loop detected for property (multiple variables):

        Binding loop is a situation where a property value is updated and that triggers other changes which (eventually) change the initial property again - this would normally lead to an infinite loop and application crash. QML engine stops such recurring bindings, though. That's why your app works normally.

        It's a very good idea to fix these issues, though. Go through your code and see where "getProfile" is modified, what will it lead to etc.

        Thank you for explaining the issue... this is something I was guessting this warning means...
        However, if I would be knowing how to modify the code to prevent this, I would not be posting :(
        Is it posible for you to have a log on the link in my first post and guide me a little?

        J.HilkJ 1 Reply Last reply
        0
        • S shokarta

          @sierdzio said in QML ApplicationWindow: Binding loop detected for property (multiple variables):

          Binding loop is a situation where a property value is updated and that triggers other changes which (eventually) change the initial property again - this would normally lead to an infinite loop and application crash. QML engine stops such recurring bindings, though. That's why your app works normally.

          It's a very good idea to fix these issues, though. Go through your code and see where "getProfile" is modified, what will it lead to etc.

          Thank you for explaining the issue... this is something I was guessting this warning means...
          However, if I would be knowing how to modify the code to prevent this, I would not be posting :(
          Is it posible for you to have a log on the link in my first post and guide me a little?

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by J.Hilk
          #4

          @shokarta a good way to start is, if you're using QtCreator to simply right click on the property and click on "Find usages" you'll get all known calls& modifications of the variable/property.

          That usually makes it very fast to find the responsible line of code.

          Thank you for explaining the issue... this is something I was guessting this warning means...

          it's not a warning it's an actual bug, and a potential app-breaking bug, as the binding is more or less suspended, after the recursion detection.


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          S 1 Reply Last reply
          2
          • J.HilkJ J.Hilk

            @shokarta a good way to start is, if you're using QtCreator to simply right click on the property and click on "Find usages" you'll get all known calls& modifications of the variable/property.

            That usually makes it very fast to find the responsible line of code.

            Thank you for explaining the issue... this is something I was guessting this warning means...

            it's not a warning it's an actual bug, and a potential app-breaking bug, as the binding is more or less suspended, after the recursion detection.

            S Offline
            S Offline
            shokarta
            wrote on last edited by
            #5

            @J.Hilk said in QML ApplicationWindow: Binding loop detected for property (multiple variables):

            @shokarta a good way to start is, if you're using QtCreator to simply right click on the property and click on "Find usages" you'll get all known calls& modifications of the variable/property.

            That usually makes it very fast to find the responsible line of code.

            Thank you for explaining the issue... this is something I was guessting this warning means...

            it's not a warning it's an actual bug, and a potential app-breaking bug, as the binding is more or less suspended, after the recursion detection.

            well I have checked this.... and it seems to be quite ok :/

            C:\asteroid\asteroid-sporttracking-master\MainScreen.qml
                                text: '<b>ID:</b> ' + getProfile['id']
                                text: '<b>Gender:</b> ' + getProfile['gender']
                                text: '<b>Age:</b> ' + getProfile['age'] + ' years'
                                text: '<b>Weight:</b> ' + getProfile['weight'] + ' kg'
                            source: 'pics/' + getProfile['gender'] + '.png'
            C:\asteroid\asteroid-sporttracking-master\main.qml
                property var getProfile: DatabaseJS.db_getProfile()
            

            I realy dont know how it should be correctly :/

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              Indeed, that looks like there is no real binding loop there.

              However, why do you have this in code?

              property var getProfile
              // [...]
              getProfile: DatabaseJS.db_getProfile()
              

              You first create a property and set it to empty, then your declare it to have a value. Not sure but maybe QML engine is misinterpreting that as a loop. Use a single line instead:

              property var getProfile: DatabaseJS.db_getProfile()
              

              (Z(:^

              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