QgsMemoryProviderUtils class

Utility functions for use with the memory vector data provider.

Contents

Public static functions

static auto createMemoryLayer(const QString& name, const QgsFields& fields, QgsWkbTypes::Type geometryType = QgsWkbTypes::NoGeometry, const QgsCoordinateReferenceSystem& crs = QgsCoordinateReferenceSystem()) -> QgsVectorLayer*
Creates a new memory layer using the specified parameters.

Function documentation

static QgsVectorLayer* QgsMemoryProviderUtils::createMemoryLayer(const QString& name, const QgsFields& fields, QgsWkbTypes::Type geometryType = QgsWkbTypes::NoGeometry, const QgsCoordinateReferenceSystem& crs = QgsCoordinateReferenceSystem())

Creates a new memory layer using the specified parameters.

Parameters
name layer name
fields fields for layer
geometryType optional layer geometry type
crs optional layer CRS for layers with geometry

The caller takes responsibility for deleting the newly created layer.