Expose boolean field creation support for other OGR supported drivers

This commit is contained in:
Nyall Dawson 2017-12-12 10:53:05 +10:00
parent f64f41a392
commit c15ef22ee2

View File

@ -466,9 +466,15 @@ QgsOgrProvider::QgsOgrProvider( QString const &uri )
<< QgsVectorDataProvider::NativeType( tr( "Date & Time" ), QStringLiteral( "datetime" ), QVariant::DateTime );
}
if ( mGDALDriverName == QLatin1String( "GPKG" ) )
if ( mGDALDriverName == QLatin1String( "GeoJSON" ) ||
mGDALDriverName == QLatin1String( "GML" ) ||
mGDALDriverName == QLatin1String( "CSV" ) ||
mGDALDriverName == QLatin1String( "PostgreSQL" ) ||
mGDALDriverName == QLatin1String( "PGDump" ) ||
mGDALDriverName == QLatin1String( "SQLite" ) ||
mGDALDriverName == QLatin1String( "GPKG" ) )
{
// boolean data type - likely other drivers also support this
// boolean data type
nativeTypes
<< QgsVectorDataProvider::NativeType( tr( "Boolean" ), QStringLiteral( "bool" ), QVariant::Bool, -1, -1, -1, -1 );
}