mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
Leave null QByteArray values as QByteArray() to maintain API
These should probably be returned as None or NULL for consistency, but let's not break API right now...
This commit is contained in:
parent
fb30022bca
commit
f23caeef50
@ -53,7 +53,8 @@ geometry and a list of field/values attributes.
|
||||
else
|
||||
{
|
||||
const QVariant v = sipCpp->attribute( a0 );
|
||||
if ( QgsVariantUtils::isNull( v, true ) )
|
||||
// QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip
|
||||
if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray )
|
||||
{
|
||||
Py_INCREF( Py_None );
|
||||
sipRes = Py_None;
|
||||
@ -115,7 +116,8 @@ geometry and a list of field/values attributes.
|
||||
else
|
||||
{
|
||||
const QVariant v = sipCpp->attribute( fieldIdx );
|
||||
if ( QgsVariantUtils::isNull( v, true ) )
|
||||
// QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip
|
||||
if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray )
|
||||
{
|
||||
Py_INCREF( Py_None );
|
||||
sipRes = Py_None;
|
||||
|
@ -57,7 +57,8 @@ geometry and a list of field/values attributes.
|
||||
Py_INCREF( Py_None );
|
||||
sipRes = Py_None;
|
||||
}
|
||||
else if ( QgsVariantUtils::isNull( v, true ) )
|
||||
// QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip
|
||||
else if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray )
|
||||
{
|
||||
PyObject *vartype = sipConvertFromEnum( v.type(), sipType_QVariant_Type );
|
||||
PyObject *args = PyTuple_Pack( 1, vartype );
|
||||
@ -128,7 +129,8 @@ geometry and a list of field/values attributes.
|
||||
Py_INCREF( Py_None );
|
||||
sipRes = Py_None;
|
||||
}
|
||||
else if ( QgsVariantUtils::isNull( v, true ) )
|
||||
// QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip
|
||||
else if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray )
|
||||
{
|
||||
PyObject *vartype = sipConvertFromEnum( v.type(), sipType_QVariant_Type );
|
||||
PyObject *args = PyTuple_Pack( 1, vartype );
|
||||
|
@ -96,7 +96,8 @@ class CORE_EXPORT QgsFeature
|
||||
Py_INCREF( Py_None );
|
||||
sipRes = Py_None;
|
||||
}
|
||||
else if ( QgsVariantUtils::isNull( v, true ) )
|
||||
// QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip
|
||||
else if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray )
|
||||
{
|
||||
PyObject *vartype = sipConvertFromEnum( v.type(), sipType_QVariant_Type );
|
||||
PyObject *args = PyTuple_Pack( 1, vartype );
|
||||
@ -167,7 +168,8 @@ class CORE_EXPORT QgsFeature
|
||||
Py_INCREF( Py_None );
|
||||
sipRes = Py_None;
|
||||
}
|
||||
else if ( QgsVariantUtils::isNull( v, true ) )
|
||||
// QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip
|
||||
else if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray )
|
||||
{
|
||||
PyObject *vartype = sipConvertFromEnum( v.type(), sipType_QVariant_Type );
|
||||
PyObject *args = PyTuple_Pack( 1, vartype );
|
||||
@ -236,7 +238,8 @@ class CORE_EXPORT QgsFeature
|
||||
else
|
||||
{
|
||||
const QVariant v = sipCpp->attribute( a0 );
|
||||
if ( QgsVariantUtils::isNull( v, true ) )
|
||||
// QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip
|
||||
if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray )
|
||||
{
|
||||
Py_INCREF( Py_None );
|
||||
sipRes = Py_None;
|
||||
@ -298,7 +301,8 @@ class CORE_EXPORT QgsFeature
|
||||
else
|
||||
{
|
||||
const QVariant v = sipCpp->attribute( fieldIdx );
|
||||
if ( QgsVariantUtils::isNull( v, true ) )
|
||||
// QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip
|
||||
if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray )
|
||||
{
|
||||
Py_INCREF( Py_None );
|
||||
sipRes = Py_None;
|
||||
|
Loading…
x
Reference in New Issue
Block a user