Skip to content

Commit

Permalink
fix #1613 Deprecated QGIS API for writeAsVectorFormatV2
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Oct 24, 2023
1 parent 3dcf1cb commit ef311f3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/projectwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,16 @@ QgsVectorLayer *ProjectWizard::createGpkgLayer( QString const &projectDir, QList
options.driverName = QStringLiteral( "GPKG" );
options.layerName = layerName;
options.fileEncoding = QStringLiteral( "UTF-8" );
std::unique_ptr< QgsVectorFileWriter > writer( QgsVectorFileWriter::create( projectGpkgPath, predefinedFields, Qgis::WkbType::PointZ, layerCrs, QgsCoordinateTransformContext(), options ) );


QString errorMessage;
QgsVectorFileWriter::writeAsVectorFormatV2(
QgsVectorFileWriter::writeAsVectorFormatV3(
layer,
projectGpkgPath,
layer->transformContext(),
options,
&errorMessage,
nullptr,
nullptr,
&errorMessage );
nullptr );

// Check and configure layer
QgsVectorLayer *l = new QgsVectorLayer( projectGpkgPath, layerName, "ogr" );
Expand Down

0 comments on commit ef311f3

Please sign in to comment.