aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-10-09 10:43:57 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-10-09 15:59:49 +0200
commitf1d5b567bd51c23bed686ae648d7c0a0a3e8b0d8 (patch)
tree6f939a623d043c1aba608d5aea6cc340ee60c3a9
parent0a0d9690a90340c4bd6d9503dc78abee70ea4739 (diff)
Postpone the Binding restore mode behavior change to Qt 6.0
Also, add a note to the "when" property about it. [ChangeLog] The change in the default behavior of Binding elements regarding literal values has been postponed to Qt 6.0. Task-number: QTBUG-78566 Change-Id: I2cc6f01230589b176b08f53a45c02123bb961020 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/qml/types/qqmlbind.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/qml/types/qqmlbind.cpp b/src/qml/types/qqmlbind.cpp
index 36de16a818..7ab854dad0 100644
--- a/src/qml/types/qqmlbind.cpp
+++ b/src/qml/types/qqmlbind.cpp
@@ -193,6 +193,13 @@ QQmlBind::~QQmlBind()
When the binding becomes inactive again, any direct bindings that were previously
set on the property will be restored.
+
+ \note By default, a previously set literal value is not restored when the Binding becomes
+ inactive. Rather, the last value set by the now inactive Binding is retained. You can customize
+ the restoration behavior for literal values as well as bindings using the \l restoreMode
+ property. The default will change in Qt 6.0.
+
+ \sa restoreMode
*/
bool QQmlBind::when() const
{
@@ -360,7 +367,7 @@ void QQmlBind::setDelayed(bool delayed)
\endlist
\warning The default value is Binding.RestoreBinding. This will change in
- Qt 5.15 to Binding.RestoreBindingOrValue.
+ Qt 6.0 to Binding.RestoreBindingOrValue.
If you rely on any specific behavior regarding the restoration of plain
values when bindings get disabled you should migrate to explicitly set the
@@ -461,8 +468,8 @@ void QQmlBind::eval()
qmlWarning(this)
<< "Not restoring previous value because restoreMode has not been set."
<< "This behavior is deprecated."
- << "In Qt < 5.15 the default is Binding.RestoreBinding."
- << "In Qt >= 5.15 the default is Binding.RestoreBindingOrValue.";
+ << "In Qt < 6.0 the default is Binding.RestoreBinding."
+ << "In Qt >= 6.0 the default is Binding.RestoreBindingOrValue.";
}
} else if (d->prevIsVariant) {
if (d->restoreValue) {
@@ -472,8 +479,8 @@ void QQmlBind::eval()
qmlWarning(this)
<< "Not restoring previous value because restoreMode has not been set."
<< "This behavior is deprecated."
- << "In Qt < 5.15 the default is Binding.RestoreBinding."
- << "In Qt >= 5.15 the default is Binding.RestoreBindingOrValue.";
+ << "In Qt < 6.0 the default is Binding.RestoreBinding."
+ << "In Qt >= 6.0 the default is Binding.RestoreBindingOrValue.";
}
}
return;