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>
This commit is contained in:
Lars Knoll 2020-09-02 09:12:15 +02:00
parent b788c64dc3
commit af149ada60

View File

@ -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;