QGIS API Documentation  3.2.0-Bonn (bc43194)
Public Member Functions | Public Attributes | List of all members
QgsMimeDataUtils::Uri Struct Reference

#include <qgsmimedatautils.h>

Public Member Functions

 Uri ()=default
 Constructs invalid URI. More...
 
 Uri (QString &encData)
 Constructs URI from encoded data. More...
 
QString data () const
 Returns encoded representation of the object. More...
 
bool isValid () const
 Returns whether the object contains valid data. More...
 
QgsMeshLayermeshLayer (bool &owner, QString &error) const
 Gets mesh layer from uri if possible, otherwise returns 0 and error is set. More...
 
QgsRasterLayerrasterLayer (bool &owner, QString &error) const
 Gets raster layer from uri if possible, otherwise returns 0 and error is set. More...
 
QgsVectorLayervectorLayer (bool &owner, QString &error) const
 Gets vector layer from uri if possible, otherwise returns 0 and error is set. More...
 

Public Attributes

QString layerType
 Type of URI. Recognized types: "vector" / "raster" / "mesh" / "plugin" / "custom" / "project". More...
 
QString name
 Human readable name to be used e.g. in layer tree. More...
 
QString providerKey
 For "vector" / "raster" type: provider id. More...
 
QStringList supportedCrs
 
QStringList supportedFormats
 
QString uri
 Identifier of the data source recognized by its providerKey. More...
 

Detailed Description

Definition at line 37 of file qgsmimedatautils.h.

Constructor & Destructor Documentation

◆ Uri() [1/2]

QgsMimeDataUtils::Uri::Uri ( )
default

Constructs invalid URI.

◆ Uri() [2/2]

QgsMimeDataUtils::Uri::Uri ( QString &  encData)
explicit

Constructs URI from encoded data.

Definition at line 31 of file qgsmimedatautils.cpp.

Member Function Documentation

◆ data()

QString QgsMimeDataUtils::Uri::data ( ) const

Returns encoded representation of the object.

Definition at line 60 of file qgsmimedatautils.cpp.

◆ isValid()

bool QgsMimeDataUtils::Uri::isValid ( ) const
inline

Returns whether the object contains valid data.

Since
QGIS 3.0

Definition at line 48 of file qgsmimedatautils.h.

◆ meshLayer()

QgsMeshLayer * QgsMimeDataUtils::Uri::meshLayer ( bool &  owner,
QString &  error 
) const

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

Parameters
ownerset to true if caller becomes owner
errorset to error message if cannot get raster

Definition at line 112 of file qgsmimedatautils.cpp.

◆ rasterLayer()

QgsRasterLayer * QgsMimeDataUtils::Uri::rasterLayer ( bool &  owner,
QString &  error 
) const

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

Parameters
ownerset to true if caller becomes owner
errorset to error message if cannot get raster

Definition at line 100 of file qgsmimedatautils.cpp.

◆ vectorLayer()

QgsVectorLayer * QgsMimeDataUtils::Uri::vectorLayer ( bool &  owner,
QString &  error 
) const

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

Parameters
ownerset to true if caller becomes owner
errorset to error message if cannot get vector

Definition at line 65 of file qgsmimedatautils.cpp.

Member Data Documentation

◆ layerType

QString QgsMimeDataUtils::Uri::layerType

Type of URI. Recognized types: "vector" / "raster" / "mesh" / "plugin" / "custom" / "project".

Definition at line 75 of file qgsmimedatautils.h.

◆ name

QString QgsMimeDataUtils::Uri::name

Human readable name to be used e.g. in layer tree.

Definition at line 85 of file qgsmimedatautils.h.

◆ providerKey

QString QgsMimeDataUtils::Uri::providerKey

For "vector" / "raster" type: provider id.

For "plugin" type: plugin layer type name. For "custom" type: key of its QgsCustomDropHandler For "project" type: unused

Definition at line 83 of file qgsmimedatautils.h.

◆ supportedCrs

QStringList QgsMimeDataUtils::Uri::supportedCrs

Definition at line 88 of file qgsmimedatautils.h.

◆ supportedFormats

QStringList QgsMimeDataUtils::Uri::supportedFormats

Definition at line 89 of file qgsmimedatautils.h.

◆ uri

QString QgsMimeDataUtils::Uri::uri

Identifier of the data source recognized by its providerKey.

Definition at line 87 of file qgsmimedatautils.h.


The documentation for this struct was generated from the following files: