QML ApplicationWindow: Binding loop detected for property (multiple variables)
-
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
-
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.
-
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.
@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? -
@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?@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.
-
@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.
@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 :/
-
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()