diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-03-17 15:20:09 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-03-24 13:14:11 +0000 |
commit | ab22b8bbd3496466585092458c5038329636c4e1 (patch) | |
tree | bfad38be0883dbfde56e7ed858dad7d9750375e7 /src/quick/util/qquickbehavior.cpp | |
parent | 8215ad2eee49efc244de9dfd6d3d52bbcfc184a6 (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
Change-Id: Ia289eb734288a4bcc02444fcb73781a57216c908
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit aa4e5d598248008f8490eef07288f60af6f77900)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/util/qquickbehavior.cpp')
-rw-r--r-- | src/quick/util/qquickbehavior.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/quick/util/qquickbehavior.cpp b/src/quick/util/qquickbehavior.cpp index eeda609816..402c23e2af 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())); |