The question is all about QtQml 2.15 Binding type. The infamous missing
unexported `restoreMode` property sure makes our lifes slightly harder
than it should be (by generating warnings if left out); but when it
comes to choosing an appropriate value for it -- I am totally lost.

The short story is: Always set it to RestoreBindingOrValue and adapt your code as appropriate. All the other options are hacks introduced for backwards compatibility.

In previous versions of Qt, there was no restoreMode and the behavior was broken. Therefore we first introduced a switch you can use to opt into the sane behavior and then made the sane behavior the default. You can still explicitly select the insane behavior, but don't.

Note that documentation doesn't come with any examples for restoreMode.

Because you shouldn't use it anymore.

Also, any reason as to why Binding is `setValue(const QJSValue &)`, but
QQuickPropertyAction is `setValue(const QVariant &v)`? I mean, QJSValue vs
QVariant differences.

This is also a historical artifact. We've changed the type as a fix for QTBUG-78943 . Since https://codereview.qt-project.org/c/qt/qtdeclarative/+/305210 that "fix" may be obsolete as we don't magically convert strings to colors anymore.

best regards,
Ulf
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to