Commit 2f5c906d authored by Marco Bubke's avatar Marco Bubke Committed by Kai Koehne
Browse files

Improve NodeInstanceMetaObject workaround for NaN values

The old was wrong in the assumption that the pointer is allways a
variant.

Reviewed-by: kkoehne
parent 75d1fa5d
......@@ -34,11 +34,24 @@ int NodeInstanceMetaObject::metaCall(QMetaObject::Call call, int id, void **a)
int metaCallReturnValue = -1;
if (call == QMetaObject::WriteProperty
&& property(id).userType() == QMetaType::QVariant
&& reinterpret_cast<QVariant *>(a[0])->type() == QVariant::Double
&& qIsNaN(reinterpret_cast<QVariant *>(a[0])->toDouble())) {
return -1;
}
if (call == QMetaObject::WriteProperty
&& property(id).userType() == QMetaType::Double
&& qIsNaN(*reinterpret_cast<double*>(a[0]))) {
return -1;
}
if (call == QMetaObject::WriteProperty
&& property(id).userType() == QMetaType::Float
&& qIsNaN(*reinterpret_cast<float*>(a[0]))) {
return -1;
}
QVariant oldValue;
if (call == QMetaObject::WriteProperty && !property(id).hasNotifySignal())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment