15#ifndef QGSMIMEDATAUTILS_H
16#define QGSMIMEDATAUTILS_H
26using namespace Qt::StringLiterals;
44 struct CORE_EXPORT
Uri
49 explicit Uri(
const QString &encData );
85 QgsMeshLayer *meshLayer(
bool &owner, QString &error )
const;
167 SIP_PYOBJECT __repr__();
169 QString str = u
"<QgsMimeDataUtils::Uri (%1): %2>"_s.arg( sipCpp->providerKey, sipCpp->uri );
170 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
181 static bool isUriList(
const QMimeData *data );
199 static QString encode(
const QStringList &items );
200 static QStringList decode(
const QString &encoded );
201 static QByteArray uriListToByteArray(
const UriList &layers );
WkbType
The WKB type describes the number of dimensions a geometry has.
A browser item that represents a layer that can be opened with one of the providers.
Base class for nodes in a layer tree.
Base class for all map layer types.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Contains utility functions for working with MIME data.
static QByteArray layerTreeNodesToUriList(const QList< QgsLayerTreeNode * > &nodes)
Returns encoded URI list from a list of layer tree nodes.
static bool isUriList(const QMimeData *data)
QList< QgsMimeDataUtils::Uri > UriList
friend class TestQgsMimeDataUtils
static QMimeData * encodeUriList(const UriList &layers)
Encodes a URI list to a new QMimeData object.
static UriList decodeUriList(const QMimeData *data)
static bool hasOriginatedFromCurrentAppInstance(const QgsMimeDataUtils::Uri &uri)
Returns true if uri originated from the current QGIS application instance.
Represents a raster layer.
Represents a vector layer which manages a vector based dataset.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
Qgis::WkbType wkbType
WKB type, if associated with a vector layer, or QgsWkbTypes::Unknown if not yet known.
QString filePath
Path to file, if uri is associated with a file.
QString uri
Identifier of the data source recognized by its providerKey.
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.
QString layerId
Layer ID, if uri is associated with a layer from a QgsProject.
Uri()=default
Constructs invalid URI.
QStringList supportedFormats
QString layerType
Type of URI.
bool isValid() const
Returns whether the object contains valid data.