QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
#include <qgsmimedatautils.h>
Public Member Functions | |
Uri ()=default | |
Constructs invalid URI. | |
Uri (const QString &encData) | |
Constructs URI from encoded data. | |
Uri (QgsMapLayer *layer) | |
Constructs a URI corresponding to the specified layer. | |
QString | data () const |
Returns encoded representation of the object. | |
bool | isValid () const |
Returns whether the object contains valid data. | |
QgsMapLayer * | mapLayer () const |
Returns the layer from the active project corresponding to this uri (if possible), otherwise returns nullptr . | |
QgsMeshLayer * | meshLayer (bool &owner, QString &error) const |
Gets mesh layer from uri if possible, otherwise returns nullptr and error is set. | |
QgsRasterLayer * | rasterLayer (bool &owner, QString &error) const |
Gets raster layer from uri if possible, otherwise returns nullptr and error is set. | |
QgsVectorLayer * | vectorLayer (bool &owner, QString &error) const |
Gets vector layer from uri if possible, otherwise returns nullptr and error is set. | |
Public Attributes | |
QString | filePath |
Path to file, if uri is associated with a file. | |
QString | layerId |
Layer ID, if uri is associated with a layer from a QgsProject. | |
QString | layerType |
Type of URI. | |
QString | name |
Human readable name to be used e.g. in layer tree. | |
QString | pId |
Unique ID associated with application instance. | |
QString | providerKey |
For "vector" / "raster" type: provider id. | |
QStringList | supportedCrs |
QStringList | supportedFormats |
QString | uri |
Identifier of the data source recognized by its providerKey. | |
Qgis::WkbType | wkbType = Qgis::WkbType::Unknown |
WKB type, if associated with a vector layer, or QgsWkbTypes::Unknown if not yet known. | |
Definition at line 41 of file qgsmimedatautils.h.
|
default |
Constructs invalid URI.
|
explicit |
Constructs URI from encoded data.
Definition at line 29 of file qgsmimedatautils.cpp.
|
explicit |
Constructs a URI corresponding to the specified layer.
Definition at line 67 of file qgsmimedatautils.cpp.
QString QgsMimeDataUtils::Uri::data | ( | ) | const |
Returns encoded representation of the object.
Definition at line 119 of file qgsmimedatautils.cpp.
|
inline |
Returns whether the object contains valid data.
Definition at line 58 of file qgsmimedatautils.h.
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.
Definition at line 206 of file qgsmimedatautils.cpp.
QgsMeshLayer * QgsMimeDataUtils::Uri::meshLayer | ( | bool & | owner, |
QString & | error | ||
) | const |
Gets mesh layer from uri if possible, otherwise returns nullptr
and error is set.
owner | set to true if caller becomes owner |
error | set to error message if cannot get raster |
Definition at line 184 of file qgsmimedatautils.cpp.
QgsRasterLayer * QgsMimeDataUtils::Uri::rasterLayer | ( | bool & | owner, |
QString & | error | ||
) | const |
Gets raster layer from uri if possible, otherwise returns nullptr
and error is set.
owner | set to true if caller becomes owner |
error | set to error message if cannot get raster |
Definition at line 162 of file qgsmimedatautils.cpp.
QgsVectorLayer * QgsMimeDataUtils::Uri::vectorLayer | ( | bool & | owner, |
QString & | error | ||
) | const |
Gets vector layer from uri if possible, otherwise returns nullptr
and error is set.
owner | set to true if caller becomes owner |
error | set to error message if cannot get vector |
Definition at line 134 of file qgsmimedatautils.cpp.
QString QgsMimeDataUtils::Uri::filePath |
Path to file, if uri is associated with a file.
Definition at line 155 of file qgsmimedatautils.h.
QString QgsMimeDataUtils::Uri::layerId |
Layer ID, if uri is associated with a layer from a QgsProject.
Definition at line 134 of file qgsmimedatautils.h.
QString QgsMimeDataUtils::Uri::layerType |
Type of URI.
Recognized types include
Mime data from plugins may use additional custom layer types.
Definition at line 113 of file qgsmimedatautils.h.
QString QgsMimeDataUtils::Uri::name |
Human readable name to be used e.g. in layer tree.
Definition at line 124 of file qgsmimedatautils.h.
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.
Definition at line 141 of file qgsmimedatautils.h.
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 121 of file qgsmimedatautils.h.
QStringList QgsMimeDataUtils::Uri::supportedCrs |
Definition at line 127 of file qgsmimedatautils.h.
QStringList QgsMimeDataUtils::Uri::supportedFormats |
Definition at line 128 of file qgsmimedatautils.h.
QString QgsMimeDataUtils::Uri::uri |
Identifier of the data source recognized by its providerKey.
Definition at line 126 of file qgsmimedatautils.h.
Qgis::WkbType QgsMimeDataUtils::Uri::wkbType = Qgis::WkbType::Unknown |
WKB type, if associated with a vector layer, or QgsWkbTypes::Unknown if not yet known.
Definition at line 149 of file qgsmimedatautils.h.