Important: Please read the Qt Code of Conduct -

Spurious Binding loop?

  • Hi,

    I am having a problem with a binding loop. I have an item which emits a signal if its position is changing due to a drag. This signal updates a property called 'value' and then I use onValueChanged to to do something else. The problem I have is that sometimes during dragging, I get a qml binding loop warning. However, not for every drag, but lets say for every 30 or 40 drag events it happens once. I want to avoid going into the details, as I cannot reproduce this with a simple example yet, my question is rather how does the binding loop detection work? I don't understand why a binding loop would be there just sometimes and othertimes not. Also, I tried to use gammaray to look into the bindings, and it does not see any loops.

    Could it be that if a property is updated too often in a short interval of time, qml thinks its a binding loop and outputs a warning?

  • Hello, since you can't reproduce with a simple example I would recommend you checking there is not a binding loop because you evaluate the same property inside a JS function or something similar. Also the issue may be related to the drag, since I do not know how it is "value" getting updated and used it may be happening that QML thinks you are in a binding loop or you may be at a binding loop if some conditions are meet after a drag that will cause "value" to modify your propertys holding the position of your item.

Log in to reply