@red.green said in How to assign property values temporarily without breaking existing binding in qml?:
How do I make sure that the previous binding is kept intact?
Assigning a value breaks the binding - if it was not this way QML would be horribly broken ;-)
There are a few ways around it, though. First, most obvious one - set the new value on the binding source. So if you have:
Text {
text: someProperty
}
Assign your temporary value to someProperty. You can add some code that will manage it's temporary nature there (onPropertyChanged or better in some object that holds the value of that property).
Another way is to set up the binding using Binding element, disable it when Cancel is pressed, then enable it again once your temporary situation changes.