QGIS API Documentation  3.24.2-Tisler (13c1a02865)
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 
20 
21 
23 {
24  QgsMapLayerFactory::LayerOptions layerOptions( options.transformContext );
25  layerOptions.loadDefaultStyle = options.loadDefaultStyle;
26  return QgsMapLayerFactory::createLayer( mUri, mName, mType, layerOptions, mProviderKey );
27 }
28 
30 {
31  return mProviderKey == other.mProviderKey
32  && mType == other.mType
33  && mFlags == other.mFlags
34  && mUri == other.mUri
35  && mLayerNumber == other.mLayerNumber
36  && mName == other.mName
37  && mDescription == other.mDescription
38  && mFeatureCount == other.mFeatureCount
39  && mGeometryColumnName == other.mGeometryColumnName
40  && mPath == other.mPath
41  && mWkbType == other.mWkbType
42  && mSkippedContainerScan == other.mSkippedContainerScan
43  && mDriverName == other.mDriverName;
44 }
45 
47 {
48  return !( *this == other );
49 }
static QgsMapLayer * createLayer(const QString &uri, const QString &name, QgsMapLayerType 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:73
Contains details about a sub layer available from a dataset.
bool operator!=(const QgsProviderSublayerDetails &other) const
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 loadDefaultStyle
Set to true if the default layer style should be loaded.
QgsCoordinateTransformContext transformContext
Coordinate transform context.
bool loadDefaultStyle
Set to true if the default layer style should be loaded.