Class: QgsNewMemoryLayerDialog

Class Hierarchy

Inheritance diagram of qgis.gui.QgsNewMemoryLayerDialog

Base classes

QDialog

QWidget

QObject

QPaintDevice

Methods

crs

Returns the selected CRS for the new layer.

fields

Returns attributes for the new layer.

layerName

Returns the layer name

selectedType

Returns the selected geometry type

setCrs

Sets the crs value for the new layer in the dialog.

Static Methods

runAndCreateLayer

Runs the dialog and creates a new memory layer

class qgis.gui.QgsNewMemoryLayerDialog(parent: QWidget | None = None, fl: Qt.WindowFlags | Qt.WindowType = QgsGuiUtils.ModalDialogFlags)[source]

Bases: QDialog

crs(self) QgsCoordinateReferenceSystem[source]

Returns the selected CRS for the new layer.

See also

setCrs()

Return type:

QgsCoordinateReferenceSystem

fields(self) QgsFields[source]

Returns attributes for the new layer.

Added in version 3.14.

Return type:

QgsFields

layerName(self) str[source]

Returns the layer name

Return type:

str

static runAndCreateLayer(parent: QWidget | None = None, defaultCrs: QgsCoordinateReferenceSystem = QgsCoordinateReferenceSystem()) QgsVectorLayer | None[source]

Runs the dialog and creates a new memory layer

Parameters:
  • parent (Optional[QWidget] = None) – parent widget

  • defaultCrs (QgsCoordinateReferenceSystem = QgsCoordinateReferenceSystem()) – default layer CRS to show in dialog

Return type:

Optional[QgsVectorLayer]

Returns:

new memory layer

selectedType(self) Qgis.WkbType[source]

Returns the selected geometry type

Return type:

Qgis.WkbType

setCrs(self, crs: QgsCoordinateReferenceSystem)[source]

Sets the crs value for the new layer in the dialog.

See also

crs()

Parameters:

crs (QgsCoordinateReferenceSystem)