Re: [Development] How to skip write property in qml's property binding?

2024-07-19 Thread JiDe Zhang
Thank you, but I can't use `text: fooObject?.foo ?? ""`, because I would not the `text` property change if when fooObject change to null. If fooObject's new value is null, I want the text​ property keep old value.​​ From: Pierre-Yves Siret Sent: Friday, July 19, 2

Re: [Development] How to skip write property in qml's property binding?

2024-07-19 Thread Pierre-Yves Siret
> > as always, it depends. If you really want to set a binding based on a > condition, but otherwise leave the value as it is, you want to use > > Text { > Binding on text { value: fooObject.title; when: fooObject } > } > Note that the `when` only affects when the binding is applied to the

[Development] WheelDeceleration for PlatformTheme and Flickable

2024-07-19 Thread Wang Gary
Hi, I have two patchset related to QML's mouse wheel deceleration support, which allow the developer fine-tune the mouse wheel deceleration behavior when needed. One patch adds an enum for PlatformTheme-level support which is for desktop-environment developers, and another patch adds a property to

Re: [Development] How to skip write property in qml's property binding?

2024-07-19 Thread JiDe Zhang
Thank you, I need Text { Binding on text { value: fooObject.title; when: fooObject } } But It's troublesome to write like this, I think the Binding is superfluous. Just like how, when detecting that the value is `undefined`, it tries to reset the property (if it has a corresponding reset

Re: [Development] How to skip write property in qml's property binding?

2024-07-19 Thread Fabian Kosmale via Development
Hi, as always, it depends. If you really want to set a binding based on a condition, but otherwise leave the value as it is, you want to use Text { Binding on text { value: fooObject.title; when: fooObject } } Compare https://doc.qt.io/qt-6/qml-qtqml-binding.html#conditional-bindings. Set