summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qproperty.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-09-02 09:12:15 +0200
committerLars Knoll <lars.knoll@qt.io>2020-09-02 22:44:28 +0200
commitaf149ada60b7fd8a51ebae97b1324e06c919f2e9 (patch)
treed7a1f45e43af4979f690b999508ffd32ed86a05c /src/corelib/kernel/qproperty.h
parentb788c64dc3a5e40ac410b9bd2c79f6f2d0963737 (diff)
Always allow setting a null binding on a property
This should always work to allow clearing a binding. Change-Id: I55165a50f7fe62a1f8a5078d452968db09a6d360 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qproperty.h')
-rw-r--r--src/corelib/kernel/qproperty.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h
index bb89dbf94f..4013b8c92b 100644
--- a/src/corelib/kernel/qproperty.h
+++ b/src/corelib/kernel/qproperty.h
@@ -407,7 +407,7 @@ public:
bool setBinding(const QUntypedPropertyBinding &newBinding)
{
- if (newBinding.valueMetaType().id() != qMetaTypeId<T>())
+ if (!newBinding.isNull() && newBinding.valueMetaType().id() != qMetaTypeId<T>())
return false;
setBinding(static_cast<const QPropertyBinding<T> &>(newBinding));
return true;