forked from qt-creator/qt-creator
QmlDesigner: Relaxe value property setter
The value.isNull() was misleading. It should only check if a value is invalid. The null sematics in Qt are special anyway because it they can be misleading. Most values have no special "null" value like pointers or NaN with floating point values. QString is for example exposes it's implementation with a pointer. Sometimes zero is reportet as null but this not what we wanted to know. So just treat null strings as empty strings. Change-Id: I6599f6c97f22aff83779a0b32415bf52fd64d82f Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -57,8 +57,7 @@ void VariantProperty::setValue(const QVariant &value)
|
||||
if (isDynamic())
|
||||
qWarning() << "Calling VariantProperty::setValue on dynamic property.";
|
||||
|
||||
// QVector*D(0, 0, 0) detects as null variant though it is valid value
|
||||
if (value.isNull() && (value.type() != QVariant::Vector3D && value.type() != QVariant::Vector2D))
|
||||
if (!value.isValid())
|
||||
throw InvalidArgumentException(__LINE__, __FUNCTION__, __FILE__, name());
|
||||
|
||||
if (internalNode()->hasProperty(name())) { //check if oldValue != value
|
||||
|
Reference in New Issue
Block a user