QGIS API Documentation 3.41.0-Master (88383c3d16f)
Loading...
Searching...
No Matches
qgsprovidersublayerdetails.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsprovidersublayerdetails.cpp
3 ----------------------------
4 begin : May 2021
5 copyright : (C) 2021 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8/***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
18#include "qgsmaplayerfactory.h"
19#include "qgsmimedatautils.h"
20
21
23{
25 layerOptions.loadDefaultStyle = options.loadDefaultStyle;
26 layerOptions.loadAllStoredStyles = options.loadAllStoredStyle;
27 return QgsMapLayerFactory::createLayer( mUri, mName, mType, layerOptions, mProviderKey );
28}
29
31{
34 switch ( mType )
35 {
37 u.wkbType = mWkbType;
38 break;
47 break;
48 }
49
50 u.providerKey = mProviderKey;
51 u.name = mName;
52 u.uri = mUri;
53 return u;
54}
55
57{
58 return mProviderKey == other.mProviderKey
59 && mType == other.mType
60 && mFlags == other.mFlags
61 && mUri == other.mUri
62 && mLayerNumber == other.mLayerNumber
63 && mName == other.mName
64 && mDescription == other.mDescription
65 && mFeatureCount == other.mFeatureCount
66 && mGeometryColumnName == other.mGeometryColumnName
67 && mPath == other.mPath
68 && mWkbType == other.mWkbType
69 && mSkippedContainerScan == other.mSkippedContainerScan
70 && mDriverName == other.mDriverName;
71}
72
74{
75 return !( *this == other );
76}
@ Group
Composite group layer. Added in QGIS 3.24.
@ Plugin
Plugin based layer.
@ TiledScene
Tiled scene layer. Added in QGIS 3.34.
@ Annotation
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
@ Vector
Vector layer.
@ VectorTile
Vector tile layer. Added in QGIS 3.14.
@ Mesh
Mesh layer. Added in QGIS 3.2.
@ Raster
Raster layer.
@ PointCloud
Point cloud layer. Added in QGIS 3.18.
static QString typeToString(Qgis::LayerType type)
Converts a map layer type to a string value.
static QgsMapLayer * createLayer(const QString &uri, const QString &name, Qgis::LayerType type, const LayerOptions &options, const QString &provider=QString())
Creates a map layer, given a uri, name, layer type and provider name.
Base class for all map layer types.
Definition qgsmaplayer.h:76
Contains details about a sub layer available from a dataset.
bool operator!=(const QgsProviderSublayerDetails &other) const
QgsMimeDataUtils::Uri toMimeUri() const
Converts the sublayer details to a QgsMimeDataUtils::Uri representing the sublayer.
QgsMapLayer * toLayer(const LayerOptions &options) const
Creates a new QgsMapLayer object associated with the sublayer.
bool operator==(const QgsProviderSublayerDetails &other) const
Setting options for loading layers.
bool loadAllStoredStyles
Controls whether the stored styles will be all loaded.
bool loadDefaultStyle
Set to true if the default layer style should be loaded.
Qgis::WkbType wkbType
WKB type, if associated with a vector layer, or QgsWkbTypes::Unknown if not yet known.
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 providerKey
For "vector" / "raster" type: provider id.
QString layerType
Type of URI.
QgsCoordinateTransformContext transformContext
Coordinate transform context.
bool loadDefaultStyle
Set to true if the default layer style should be loaded.
bool loadAllStoredStyle
Controls whether the stored styles will be all loaded.