Class: QgsMimeDataUtils

class qgis.core.QgsMimeDataUtils

Bases: sip.wrapper

QgsMimeDataUtils(QgsMimeDataUtils)

Enums

Methods

decodeUriList
encodeUriList Encodes a URI list to a new QMimeData object.
isUriList
layerTreeNodesToUriList Returns encoded URI list from a list of layer tree nodes.

Signals

Attributes

class Uri

Bases: sip.wrapper

Constructs invalid URI

QgsMimeDataUtils.Uri(encData: str) Constructs URI from encoded data

QgsMimeDataUtils.Uri(QgsMimeDataUtils.Uri)

data(self) → str

Returns encoded representation of the object

isValid(self) → bool

Returns whether the object contains valid data

New in version 3.0.

layerType
meshLayer(self, error: str) → Tuple[QgsMeshLayer, bool]

Gets mesh layer from uri if possible, otherwise returns None and error is set

Parameters:
  • owner – set to True if caller becomes owner
  • error – set to error message if cannot get raster
name
providerKey
rasterLayer(self, error: str) → Tuple[QgsRasterLayer, bool]

Gets raster layer from uri if possible, otherwise returns None and error is set

Parameters:
  • owner – set to True if caller becomes owner
  • error – set to error message if cannot get raster
supportedCrs
supportedFormats
uri
vectorLayer(self, error: str) → Tuple[QgsVectorLayer, bool]

Gets vector layer from uri if possible, otherwise returns None and error is set

Parameters:
  • owner – set to True if caller becomes owner
  • error – set to error message if cannot get vector
decodeUriList(data: QMimeData) → object
encodeUriList(layers: object) → QMimeData

Encodes a URI list to a new QMimeData object.

isUriList(data: QMimeData) → bool
layerTreeNodesToUriList(nodes: Iterable[QgsLayerTreeNode]) → QByteArray

Returns encoded URI list from a list of layer tree nodes.

New in version 3.0.