Class: QgsNewMemoryLayerDialog

A dialog for configuring the properties of a new memory (scratch) layer.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsNewMemoryLayerDialog

Base classes

QDialog

QWidget

QObject

QPaintDevice

class qgis.gui.QgsNewMemoryLayerDialog[source]

Bases: QDialog

__init__(parent: QWidget | None = None, fl: Qt.WindowFlags | Qt.WindowType = QgsGuiUtils.ModalDialogFlags)

New dialog constructor.

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

  • fl (Union[Qt.WindowFlags, Qt.WindowType] = QgsGuiUtils.ModalDialogFlags)

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)