aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-10-02 14:06:56 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-10-04 11:40:01 +0200
commit4e21daa0210b2aa385792e1c4cb01f57804c5dcb (patch)
tree20af67aa03a8c54b492a7d0916dadba39047bba6 /src/qml
parentc211b93bb87308601fe1c808634eb648d1949c40 (diff)
Re-add the warnings about deprecated default binding restore mode
We _really_ want people to port away from this. And yes, we are going to change it. Amends commit c273175ffec925a4164de41a79c21d785a1761a7. Task-number: QTBUG-33444 Task-number: QTBUG-78566 Change-Id: Iab50b8c7bad043528602e2e617c772de06d18b1e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Pierre-Yves Siret <gr3cko@gmail.com>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/types/qqmlbind.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/qml/types/qqmlbind.cpp b/src/qml/types/qqmlbind.cpp
index 9d305cd24c..8f40f4f704 100644
--- a/src/qml/types/qqmlbind.cpp
+++ b/src/qml/types/qqmlbind.cpp
@@ -359,7 +359,8 @@ void QQmlBind::setDelayed(bool delayed)
\li Binding.RestoreBindingOrValue The original value is always restored.
\endlist
- The default value is Binding.RestoreBinding.
+ \warning The default value is Binding.RestoreBinding. This will change in
+ Qt 5.15 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
@@ -456,11 +457,23 @@ void QQmlBind::eval()
Q_ASSERT(vmemo);
vmemo->setVMEProperty(propPriv->core.coreIndex(), *d->v4Value.valueRef());
d->clearPrev();
+ } else if (!d->restoreModeExplicit) {
+ 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.";
}
} else if (d->prevIsVariant) {
if (d->restoreValue) {
d->prop.write(d->prevValue);
d->clearPrev();
+ } else if (!d->restoreModeExplicit) {
+ 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.";
}
}
return;