#include <qgsmimedatautils.h>
|
| Uri ()=default |
| Constructs invalid URI. More...
|
|
| Uri (const QString &encData) |
| Constructs URI from encoded data. More...
|
|
| Uri (QgsMapLayer *layer) |
| Constructs a URI corresponding to the specified layer. More...
|
|
QString | data () const |
| Returns encoded representation of the object. More...
|
|
bool | isValid () const |
| Returns whether the object contains valid data. More...
|
|
QgsMapLayer * | mapLayer () const |
| Returns the layer from the active project corresponding to this uri (if possible), otherwise returns nullptr . More...
|
|
QgsMeshLayer * | meshLayer (bool &owner, QString &error) const |
| Gets mesh layer from uri if possible, otherwise returns nullptr and error is set. More...
|
|
QgsRasterLayer * | rasterLayer (bool &owner, QString &error) const |
| Gets raster layer from uri if possible, otherwise returns nullptr and error is set. More...
|
|
QgsVectorLayer * | vectorLayer (bool &owner, QString &error) const |
| Gets vector layer from uri if possible, otherwise returns nullptr and error is set. More...
|
|
Definition at line 40 of file qgsmimedatautils.h.
◆ Uri() [1/3]
QgsMimeDataUtils::Uri::Uri |
( |
| ) |
|
|
default |
◆ Uri() [2/3]
QgsMimeDataUtils::Uri::Uri |
( |
const QString & |
encData | ) |
|
|
explicit |
◆ Uri() [3/3]
Constructs a URI corresponding to the specified layer.
- Since
- QGIS 3.8
Definition at line 67 of file qgsmimedatautils.cpp.
◆ data()
QString QgsMimeDataUtils::Uri::data |
( |
| ) |
const |
◆ isValid()
bool QgsMimeDataUtils::Uri::isValid |
( |
| ) |
const |
|
inline |
Returns whether the object contains valid data.
- Since
- QGIS 3.0
Definition at line 58 of file qgsmimedatautils.h.
◆ mapLayer()
QgsMapLayer * QgsMimeDataUtils::Uri::mapLayer |
( |
| ) |
const |
Returns the layer from the active project corresponding to this uri (if possible), otherwise returns nullptr
.
Unlike vectorLayer(), rasterLayer(), or meshLayer(), this method will not attempt to create a new layer corresponding to the URI.
- Since
- QGIS 3.8
Definition at line 201 of file qgsmimedatautils.cpp.
◆ meshLayer()
QgsMeshLayer * QgsMimeDataUtils::Uri::meshLayer |
( |
bool & |
owner, |
|
|
QString & |
error |
|
) |
| const |
Gets mesh layer from uri if possible, otherwise returns nullptr
and error is set.
- Parameters
-
owner | set to true if caller becomes owner |
error | set to error message if cannot get raster |
Definition at line 179 of file qgsmimedatautils.cpp.
◆ rasterLayer()
QgsRasterLayer * QgsMimeDataUtils::Uri::rasterLayer |
( |
bool & |
owner, |
|
|
QString & |
error |
|
) |
| const |
Gets raster layer from uri if possible, otherwise returns nullptr
and error is set.
- Parameters
-
owner | set to true if caller becomes owner |
error | set to error message if cannot get raster |
Definition at line 157 of file qgsmimedatautils.cpp.
◆ vectorLayer()
QgsVectorLayer * QgsMimeDataUtils::Uri::vectorLayer |
( |
bool & |
owner, |
|
|
QString & |
error |
|
) |
| const |
Gets vector layer from uri if possible, otherwise returns nullptr
and error is set.
- Parameters
-
owner | set to true if caller becomes owner |
error | set to error message if cannot get vector |
Definition at line 129 of file qgsmimedatautils.cpp.
◆ filePath
QString QgsMimeDataUtils::Uri::filePath |
Path to file, if uri is associated with a file.
- Since
- QGIS 3.22
Definition at line 154 of file qgsmimedatautils.h.
◆ layerId
QString QgsMimeDataUtils::Uri::layerId |
◆ layerType
QString QgsMimeDataUtils::Uri::layerType |
Type of URI.
Recognized types include
- "vector": vector layers
- "raster": raster layers
- "mesh": mesh layers
- "pointcloud": point cloud layers
- "vector-tile": vector tile layers
- "plugin": plugin layers
- "custom": custom types
- "project": QGS/QGZ project file
- "directory": directory path
Mime data from plugins may use additional custom layer types.
Definition at line 112 of file qgsmimedatautils.h.
◆ name
QString QgsMimeDataUtils::Uri::name |
◆ pId
QString QgsMimeDataUtils::Uri::pId |
Unique ID associated with application instance.
Can be used to identify if mime data was created inside the current application instance or not.
- Since
- QGIS 3.8
Definition at line 140 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" and "directory" types: unused
Definition at line 120 of file qgsmimedatautils.h.
◆ supportedCrs
QStringList QgsMimeDataUtils::Uri::supportedCrs |
◆ supportedFormats
QStringList QgsMimeDataUtils::Uri::supportedFormats |
◆ uri
QString QgsMimeDataUtils::Uri::uri |
Identifier of the data source recognized by its providerKey.
Definition at line 125 of file qgsmimedatautils.h.
◆ wkbType
The documentation for this struct was generated from the following files: