aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickbehavior.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-03-17 15:20:09 +0100
committerUlf Hermann <ulf.hermann@qt.io>2022-03-23 23:21:56 +0100
commitaa4e5d598248008f8490eef07288f60af6f77900 (patch)
tree560a5822c4c82b9f7fccd41c85ac9b05351c5821 /src/quick/util/qquickbehavior.cpp
parentc34cdee53f81ad0d645468ebae7aa9d8cab79a3f (diff)
QQuickBehavior: Force notify when first setting the binding
If the binding on the proxy property results in the default value of the type, we still want to set the original property with that value. Fixes: QTBUG-101771 Pick-to: 6.2 6.3 Change-Id: Ia289eb734288a4bcc02444fcb73781a57216c908 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/quick/util/qquickbehavior.cpp')
-rw-r--r--src/quick/util/qquickbehavior.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/quick/util/qquickbehavior.cpp b/src/quick/util/qquickbehavior.cpp
index b2caddb5a1..0a58d2922d 100644
--- a/src/quick/util/qquickbehavior.cpp
+++ b/src/quick/util/qquickbehavior.cpp
@@ -109,8 +109,13 @@ public:
const QUntypedPropertyBinding &binding)
{
auto This = static_cast<UntypedProxyProperty *>(d);
- if (binding.valueMetaType() != This->type())
+ const QMetaType type = This->type();
+ if (binding.valueMetaType() != type)
return {};
+
+ // We want to notify in any case here because the target property should be set
+ // even if our proxy binding results in the default value.
+ QPropertyBindingPrivate::get(binding)->scheduleNotify();
return This->m_bindingData.setBinding(binding,
reinterpret_cast<QUntypedPropertyData *>(
This->m_storage.data()));