From ef311f33251d6ea2a1b22d8d39ea51df10cbbe5b Mon Sep 17 00:00:00 2001 From: PeterPetrik Date: Tue, 24 Oct 2023 16:17:56 +0200 Subject: [PATCH] fix #1613 Deprecated QGIS API for writeAsVectorFormatV2 --- app/projectwizard.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/projectwizard.cpp b/app/projectwizard.cpp index 96794bb93..62ddc622c 100644 --- a/app/projectwizard.cpp +++ b/app/projectwizard.cpp @@ -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" );