From af149ada60b7fd8a51ebae97b1324e06c919f2e9 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 2 Sep 2020 09:12:15 +0200 Subject: 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 --- src/corelib/kernel/qproperty.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()) + if (!newBinding.isNull() && newBinding.valueMetaType().id() != qMetaTypeId()) return false; setBinding(static_cast &>(newBinding)); return true; -- cgit v1.2.3