manual fix providers

This commit is contained in:
Julien Cabieces 2024-04-11 16:59:25 +02:00 committed by Nyall Dawson
parent ee260f8bde
commit a499a91900
3 changed files with 4 additions and 4 deletions

View File

@ -1353,7 +1353,7 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList &flist, Flags flags )
if ( type == QMetaType::Type::QDate || type == QMetaType::Type::QDateTime )
query.addBindValue( QgsVariantUtils::createVariant( QMetaType::Type::QString ) );
else
query.addBindValue( QVariant( type ) );
query.addBindValue( QgsVariantUtils::createVariant( type ) );
}
else if ( type == QMetaType::Type::Int )
{
@ -1644,7 +1644,7 @@ bool QgsMssqlProvider::changeAttributeValues( const QgsChangedAttributesMap &att
if ( type == QMetaType::Type::QDate || type == QMetaType::Type::QDateTime )
query.addBindValue( QgsVariantUtils::createVariant( QMetaType::Type::QString ) );
else
query.addBindValue( QVariant( type ) );
query.addBindValue( QgsVariantUtils::createVariant( type ) );
}
else if ( type == QMetaType::Type::Int )
{

View File

@ -1423,7 +1423,7 @@ void QgsOapifFeatureDownloaderImpl::run( bool serializeFeatures, long long maxFe
const auto dstFieldType = dstFields.at( j ).type();
if ( QgsVariantUtils::isNull( v ) )
dstFeat.setAttribute( j, QgsVariantUtils::createVariant( dstFieldType ) );
else if ( QgsWFSUtils::isCompatibleType( v.userType(), dstFieldType ) )
else if ( QgsWFSUtils::isCompatibleType( static_cast<QMetaType::Type>( v.userType() ), dstFieldType ) )
dstFeat.setAttribute( j, v );
else
dstFeat.setAttribute( j, QgsVectorDataProvider::convertValue( dstFieldType, v.toString() ) );

View File

@ -941,7 +941,7 @@ void QgsBackgroundCachedFeatureIterator::copyFeature( const QgsFeature &srcFeatu
const QVariant &v = srcFeature.attributes().value( idx );
const QMetaType::Type fieldType = fields.at( i ).type();
if ( QgsVariantUtils::isNull( v ) )
dstFeature.setAttribute( i, QVariant( fieldType ) );
dstFeature.setAttribute( i, QgsVariantUtils::createVariant( fieldType ) );
else if ( QgsWFSUtils::isCompatibleType( static_cast<QMetaType::Type>( v.userType() ), fieldType ) )
dstFeature.setAttribute( i, v );
else if ( fieldType == QMetaType::Type::QDateTime && !QgsVariantUtils::isNull( v ) )