QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsfilebaseddataitemprovider.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsfilebaseddataitemprovider.cpp
3  --------------------------------------
4  Date : July 2021
5  Copyright : (C) 2021 by Nyall Dawson
6  Email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
17 #include "qgsdataprovider.h"
18 #include "qgsproviderregistry.h"
19 #include "qgslogger.h"
20 #include "qgssettings.h"
21 #include "qgszipitem.h"
22 #include "qgsogrproviderutils.h"
23 #include "qgsstyle.h"
24 #include "qgsgdalutils.h"
25 #include "qgsgeopackagedataitems.h"
27 #include "qgsfieldsitem.h"
28 #include "qgsproviderutils.h"
29 #include "qgsmbtiles.h"
30 #include "qgsvectortiledataitems.h"
31 #include "qgsprovidermetadata.h"
32 #include <QUrlQuery>
33 
34 //
35 // QgsProviderSublayerItem
36 //
37 
39  const QgsProviderSublayerDetails &details, const QString &filePath )
40  : QgsLayerItem( parent, name, filePath.isEmpty() ? details.uri() : filePath, details.uri(), layerTypeFromSublayer( details ), details.providerKey() )
41  , mDetails( details )
42 {
43  mToolTip = details.uri();
44 
45  // no children, except for sqlite, which gets special handling because of the unusual situation with the spatialite provider
47 }
48 
50 {
51  QVector<QgsDataItem *> children;
52 
53  if ( mDetails.type() == QgsMapLayerType::VectorLayer )
54  {
55  // sqlite gets special handling because of the spatialite provider which supports the api required for a fields item.
56  // TODO -- allow read only fields items to be created directly from vector layers, so that all vector layers can show field items.
57  if ( mDetails.driverName() == QLatin1String( "SQLite" ) )
58  {
59  children.push_back( new QgsFieldsItem( this,
60  path() + QStringLiteral( "/columns/ " ),
61  QStringLiteral( R"(dbname="%1")" ).arg( parent()->path().replace( '"', QLatin1String( R"(\")" ) ) ),
62  QStringLiteral( "spatialite" ), QString(), name() ) );
63  }
64  }
65  return children;
66 }
67 
68 Qgis::BrowserLayerType QgsProviderSublayerItem::layerTypeFromSublayer( const QgsProviderSublayerDetails &sublayer )
69 {
70  switch ( sublayer.type() )
71  {
73  {
74  switch ( QgsWkbTypes::geometryType( sublayer.wkbType() ) )
75  {
78 
81 
84 
87 
90  }
91 
92  break;
93  }
96 
99 
102 
105 
108 
111  break;
112  }
114 }
115 
117 {
118  return mDetails.name();
119 }
120 
121 //
122 // QgsFileDataCollectionItem
123 //
124 
125 QgsFileDataCollectionItem::QgsFileDataCollectionItem( QgsDataItem *parent, const QString &name, const QString &path, const QList<QgsProviderSublayerDetails> &sublayers )
126  : QgsDataCollectionItem( parent, name, path )
127  , mSublayers( sublayers )
128 {
131  else
133 
134  if ( !qgsVsiPrefix( path ).isEmpty() )
135  {
136  mIconName = QStringLiteral( "/mIconZip.svg" );
137  }
138 }
139 
141 {
142  QList< QgsProviderSublayerDetails> sublayers;
144  || mSublayers.empty() )
145  {
147  }
148  else
149  {
150  sublayers = mSublayers;
151  }
152  // only ever use the initial sublayers for first population -- after that we requery when asked to create children,
153  // or the item won't "refresh" and update its sublayers when the actual file changes
154  mSublayers.clear();
155  // remove the fast flag -- after the first population we need to requery the dataset
157 
158  QVector<QgsDataItem *> children;
159  children.reserve( sublayers.size() );
160  for ( const QgsProviderSublayerDetails &sublayer : std::as_const( sublayers ) )
161  {
162  QgsProviderSublayerItem *item = new QgsProviderSublayerItem( this, sublayer.name(), sublayer, QString() );
163  children.append( item );
164  }
165 
166  return children;
167 }
168 
170 {
171  return true;
172 }
173 
175 {
176  QgsMimeDataUtils::Uri collectionUri;
177  collectionUri.uri = path();
178  collectionUri.layerType = QStringLiteral( "collection" );
179  collectionUri.filePath = path();
180  return { collectionUri };
181 }
182 
184 {
185  // sqlite gets special handling because of the spatialite provider which supports the api required database connections
186  const QFileInfo fi( mPath );
187  if ( fi.suffix().toLower() != QLatin1String( "sqlite" ) && fi.suffix().toLower() != QLatin1String( "db" ) )
188  {
189  return nullptr;
190  }
191 
193 
194  // test that file is valid with OGR
195  if ( OGRGetDriverCount() == 0 )
196  {
197  OGRRegisterAll();
198  }
199  // do not print errors, but write to debug
200  CPLPushErrorHandler( CPLQuietErrorHandler );
201  CPLErrorReset();
202  gdal::dataset_unique_ptr hDS( GDALOpenEx( path().toUtf8().constData(), GDAL_OF_VECTOR | GDAL_OF_READONLY, nullptr, nullptr, nullptr ) );
203  CPLPopErrorHandler();
204 
205  if ( ! hDS )
206  {
207  QgsDebugMsgLevel( QStringLiteral( "GDALOpen error # %1 : %2 on %3" ).arg( CPLGetLastErrorNo() ).arg( CPLGetLastErrorMsg() ).arg( path() ), 2 );
208  return nullptr;
209  }
210 
211  GDALDriverH hDriver = GDALGetDatasetDriver( hDS.get() );
212  QString driverName = GDALGetDriverShortName( hDriver );
213 
214  if ( driverName == QLatin1String( "SQLite" ) )
215  {
216  QgsProviderMetadata *md { QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "spatialite" ) ) };
217  if ( md )
218  {
219  QgsDataSourceUri uri;
220  uri.setDatabase( path( ) );
221  conn = static_cast<QgsAbstractDatabaseProviderConnection *>( md->createConnection( uri.uri(), {} ) );
222  }
223  }
224  return conn;
225 }
226 
227 //
228 // QgsFileBasedDataItemProvider
229 //
230 
232 {
233  return QStringLiteral( "files" );
234 }
235 
237 {
239 }
240 
242 {
243  if ( path.isEmpty() )
244  return nullptr;
245 
246  const QFileInfo info( path );
247  QString suffix = info.suffix().toLower();
248  const QString name = info.fileName();
249 
250  // special handling for some suffixes
251  if ( suffix.compare( QLatin1String( "gpkg" ), Qt::CaseInsensitive ) == 0 )
252  {
253  // Geopackage is special -- it gets a dedicated collection item type
254  QgsGeoPackageCollectionItem *item = new QgsGeoPackageCollectionItem( parentItem, name, path );
255  item->setCapabilities( item->capabilities2() | Qgis::BrowserItemCapability::ItemRepresentsFile );
256  return item;
257  }
258  else if ( suffix == QLatin1String( "txt" ) )
259  {
260  // never ever show .txt files as datasets in browser -- they are only used for geospatial data in extremely rare cases
261  // and are predominantly just noise in the browser
262  return nullptr;
263  }
264  // If a .tab exists, then the corresponding .map/.dat is very likely a
265  // side-car file of the .tab
266  else if ( suffix == QLatin1String( "map" ) || suffix == QLatin1String( "dat" ) )
267  {
268  if ( QFile::exists( QDir( info.path() ).filePath( info.baseName() + ".tab" ) ) || QFile::exists( QDir( info.path() ).filePath( info.baseName() + ".TAB" ) ) )
269  return nullptr;
270  }
271  // .dbf and .shx should only appear if .shp is not present
272  else if ( suffix == QLatin1String( "dbf" ) || suffix == QLatin1String( "shx" ) )
273  {
274  if ( QFile::exists( QDir( info.path() ).filePath( info.baseName() + ".shp" ) ) || QFile::exists( QDir( info.path() ).filePath( info.baseName() + ".SHP" ) ) )
275  return nullptr;
276  }
277  // skip QGIS style xml files
278  else if ( suffix == QLatin1String( "xml" ) && QgsStyle::isXmlStyleFile( path ) )
279  {
280  return nullptr;
281  }
282  // GDAL 3.1 Shapefile driver directly handles .shp.zip files
283  else if ( path.endsWith( QLatin1String( ".shp.zip" ), Qt::CaseInsensitive ) &&
284  GDALIdentifyDriverEx( path.toUtf8().constData(), GDAL_OF_VECTOR, nullptr, nullptr ) )
285  {
286  suffix = QStringLiteral( "shp.zip" );
287  }
288  // special handling for mbtiles files
289  else if ( suffix == QLatin1String( "mbtiles" ) )
290  {
291  QgsMbTiles reader( path );
292  if ( reader.open() )
293  {
294  if ( reader.metadataValue( QStringLiteral( "format" ) ) == QLatin1String( "pbf" ) )
295  {
296  // these are vector tiles
297  QUrlQuery uq;
298  uq.addQueryItem( QStringLiteral( "type" ), QStringLiteral( "mbtiles" ) );
299  uq.addQueryItem( QStringLiteral( "url" ), path );
300  const QString encodedUri = uq.toString();
301  QgsVectorTileLayerItem *item = new QgsVectorTileLayerItem( parentItem, name, path, encodedUri );
302  item->setCapabilities( item->capabilities2() | Qgis::BrowserItemCapability::ItemRepresentsFile );
303  return item;
304  }
305  else
306  {
307  // handled by WMS provider
308  QUrlQuery uq;
309  uq.addQueryItem( QStringLiteral( "type" ), QStringLiteral( "mbtiles" ) );
310  uq.addQueryItem( QStringLiteral( "url" ), QUrl::fromLocalFile( path ).toString() );
311  const QString encodedUri = uq.toString();
312  QgsLayerItem *item = new QgsLayerItem( parentItem, name, path, encodedUri, Qgis::BrowserLayerType::Raster, QStringLiteral( "wms" ) );
315  return item;
316  }
317  }
318  }
319 
320  // hide blocklisted URIs, such as .aux.xml files
321  if ( QgsProviderRegistry::instance()->uriIsBlocklisted( path ) )
322  return nullptr;
323 
324  QgsSettings settings;
325 
326  Qgis::SublayerQueryFlags queryFlags = Qgis::SublayerQueryFlags();
327 
328  // should we fast scan only?
329  if ( ( settings.value( QStringLiteral( "qgis/scanItemsInBrowser2" ),
330  "extension" ).toString() == QLatin1String( "extension" ) ) ||
331  ( parentItem && settings.value( QStringLiteral( "qgis/scanItemsFastScanUris" ),
332  QStringList() ).toStringList().contains( parentItem->path() ) ) )
333  {
334  queryFlags |= Qgis::SublayerQueryFlag::FastScan;
335  }
336 
337  const QList<QgsProviderSublayerDetails> sublayers = QgsProviderRegistry::instance()->querySublayers( path, queryFlags );
338 
339  if ( sublayers.size() == 1
342  )
343  {
344  QgsProviderSublayerItem *item = new QgsProviderSublayerItem( parentItem, name, sublayers.at( 0 ), path );
346  return item;
347  }
348  else if ( !sublayers.empty() )
349  {
350  QgsFileDataCollectionItem *item = new QgsFileDataCollectionItem( parentItem, name, path, sublayers );
352  return item;
353  }
354  else
355  {
356  return nullptr;
357  }
358 }
359 
361 {
362  QFileInfo info( path );
363  QString suffix = info.suffix().toLower();
364 
365  QStringList dirExtensions = QgsOgrProviderUtils::directoryExtensions();
366  return dirExtensions.contains( suffix );
367 }
QgsFileBasedDataItemProvider::handlesDirectoryPath
bool handlesDirectoryPath(const QString &path) override
Returns true if the provider will handle the directory at the specified path.
Definition: qgsfilebaseddataitemprovider.cpp:360
QgsMimeDataUtils::Uri::uri
QString uri
Identifier of the data source recognized by its providerKey.
Definition: qgsmimedatautils.h:125
QgsFileDataCollectionItem::hasDragEnabled
bool hasDragEnabled() const override
Returns true if the item may be dragged.
Definition: qgsfilebaseddataitemprovider.cpp:169
QgsDataSourceUri
Class for storing the component parts of a RDBMS data source URI (e.g. a Postgres data source).
Definition: qgsdatasourceuri.h:37
QgsDataCollectionItem
A Collection: logical collection of layers or subcollections, e.g. GRASS location/mapset,...
Definition: qgsdatacollectionitem.h:28
QgsStyle::isXmlStyleFile
static bool isXmlStyleFile(const QString &path)
Tests if the file at path is a QGIS style XML file.
Definition: qgsstyle.cpp:3034
QgsProviderSublayerDetails::driverName
QString driverName() const
Returns the layer's driver name.
Definition: qgsprovidersublayerdetails.h:166
QgsDataItem::path
QString path() const
Definition: qgsdataitem.h:354
QgsProviderRegistry::querySublayers
QList< QgsProviderSublayerDetails > querySublayers(const QString &uri, Qgis::SublayerQueryFlags flags=Qgis::SublayerQueryFlags(), QgsFeedback *feedback=nullptr) const
Queries the specified uri and returns a list of any valid sublayers found in the dataset which can be...
Definition: qgsproviderregistry.cpp:958
QgsSettings::value
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
Definition: qgssettings.cpp:161
QgsMapLayerType::MeshLayer
@ MeshLayer
Mesh layer. Added in QGIS 3.2.
QgsWkbTypes::NullGeometry
@ NullGeometry
Definition: qgswkbtypes.h:146
QgsMapLayerType::VectorLayer
@ VectorLayer
Vector layer.
Qgis::BrowserItemState::NotPopulated
@ NotPopulated
Children not yet created.
QgsDebugMsgLevel
#define QgsDebugMsgLevel(str, level)
Definition: qgslogger.h:39
QgsProviderSublayerDetails::uri
QString uri() const
Returns the layer's URI.
Definition: qgsprovidersublayerdetails.h:81
QgsProviderSublayerItem
A generic data item for file based layers.
Definition: qgsfilebaseddataitemprovider.h:44
qgsgdalutils.h
QgsMimeDataUtils::Uri::layerType
QString layerType
Type of URI.
Definition: qgsmimedatautils.h:112
QgsFileDataCollectionItem::databaseConnection
QgsAbstractDatabaseProviderConnection * databaseConnection() const override
For data items that represent a DB connection or one of its children, this method returns a connectio...
Definition: qgsfilebaseddataitemprovider.cpp:183
QgsMapLayerType::AnnotationLayer
@ AnnotationLayer
Contains freeform, georeferenced annotations. Added in QGIS 3.16.
QgsMbTiles::open
bool open()
Tries to open the file, returns true on success.
Definition: qgsmbtiles.cpp:29
Qgis::BrowserLayerType::PointCloud
@ PointCloud
Point cloud layer.
QgsFileDataCollectionItem::QgsFileDataCollectionItem
QgsFileDataCollectionItem(QgsDataItem *parent, const QString &name, const QString &path, const QList< QgsProviderSublayerDetails > &sublayers)
Constructor for QgsFileDataCollectionItem.
Definition: qgsfilebaseddataitemprovider.cpp:125
QgsDataSourceUri::setDatabase
void setDatabase(const QString &database)
Sets the URI database name.
Definition: qgsdatasourceuri.cpp:732
QgsDataItem::name
QString name() const
Returns the name of the item (the displayed text for the item).
Definition: qgsdataitem.h:345
QgsSettings
This class is a composition of two QSettings instances:
Definition: qgssettings.h:61
Qgis::SublayerQueryFlag::FastScan
@ FastScan
Indicates that the provider must scan for sublayers using the fastest possible approach – e....
QgsMimeDataUtils::UriList
QList< QgsMimeDataUtils::Uri > UriList
Definition: qgsmimedatautils.h:164
QgsFieldsItem
A collection of field items with some internal logic to retrieve the fields and a the vector layer in...
Definition: qgsfieldsitem.h:33
QgsDataItem::mIconName
QString mIconName
Definition: qgsdataitem.h:457
Qgis::BrowserLayerType
BrowserLayerType
Browser item layer types.
Definition: qgis.h:402
QgsDataItem::mToolTip
QString mToolTip
Definition: qgsdataitem.h:456
QgsWkbTypes::PolygonGeometry
@ PolygonGeometry
Definition: qgswkbtypes.h:144
qgsmbtiles.h
Qgis::BrowserLayerType::Mesh
@ Mesh
Mesh layer.
QgsFileDataCollectionItem::mimeUris
QgsMimeDataUtils::UriList mimeUris() const override
Returns mime URIs for the data item, most data providers will only return a single URI but some data ...
Definition: qgsfilebaseddataitemprovider.cpp:174
QgsFileDataCollectionItem
A data collection item for file based data collections (e.g. NetCDF files).
Definition: qgsfilebaseddataitemprovider.h:77
QgsProviderUtils::sublayerDetailsAreIncomplete
static bool sublayerDetailsAreIncomplete(const QList< QgsProviderSublayerDetails > &details, QgsProviderUtils::SublayerCompletenessFlags flags=QgsProviderUtils::SublayerCompletenessFlags())
Returns true if the sublayer details are incomplete, and require a more in-depth scan.
Definition: qgsproviderutils.cpp:22
Qgis::BrowserLayerType::Plugin
@ Plugin
Plugin based layer.
QgsMbTiles
Utility class for reading and writing MBTiles files (which are SQLite3 databases).
Definition: qgsmbtiles.h:38
qgsprovidermetadata.h
Qgis::BrowserItemCapability::ItemRepresentsFile
@ ItemRepresentsFile
Item's path() directly represents a file on disk (since QGIS 3.22)
qgsproviderregistry.h
gdal::dataset_unique_ptr
std::unique_ptr< std::remove_pointer< GDALDatasetH >::type, GDALDatasetCloser > dataset_unique_ptr
Scoped GDAL dataset.
Definition: qgsogrutils.h:139
QgsDataItem::parent
QgsDataItem * parent() const
Gets item parent.
Definition: qgsdataitem.h:330
QgsMapLayerType::GroupLayer
@ GroupLayer
Composite group layer. Added in QGIS 3.24.
QgsMapLayerType::RasterLayer
@ RasterLayer
Raster layer.
Qgis::BrowserItemState::Populated
@ Populated
Children created.
QgsDataItem::setState
virtual void setState(Qgis::BrowserItemState state)
Set item state.
Definition: qgsdataitem.cpp:557
QgsProviderSublayerDetails
Contains details about a sub layer available from a dataset.
Definition: qgsprovidersublayerdetails.h:44
QgsMimeDataUtils::Uri::filePath
QString filePath
Path to file, if uri is associated with a file.
Definition: qgsmimedatautils.h:154
QgsProviderUtils::SublayerCompletenessFlag::IgnoreUnknownFeatureCount
@ IgnoreUnknownFeatureCount
Indicates that an unknown feature count should not be considered as incomplete.
qgsfieldsitem.h
Qgis::BrowserLayerType::NoType
@ NoType
No type.
qgsproviderutils.h
QgsProviderRegistry::providerMetadata
QgsProviderMetadata * providerMetadata(const QString &providerKey) const
Returns metadata of the provider or nullptr if not found.
Definition: qgsproviderregistry.cpp:873
QgsMimeDataUtils::Uri
Definition: qgsmimedatautils.h:40
qgsVsiPrefix
QString qgsVsiPrefix(const QString &path)
Definition: qgis.cpp:192
QgsMbTiles::metadataValue
QString metadataValue(const QString &key) const
Requests metadata value for the given key.
Definition: qgsmbtiles.cpp:80
QgsProviderMetadata
Holds data provider key, description, and associated shared library file or function pointer informat...
Definition: qgsprovidermetadata.h:177
QgsDataProvider::File
@ File
Definition: qgsdataprovider.h:79
qgsstyle.h
QgsProviderSublayerDetails::name
QString name() const
Returns the layer's name.
Definition: qgsprovidersublayerdetails.h:122
qgsfilebaseddataitemprovider.h
Qgis::BrowserLayerType::VectorTile
@ VectorTile
Vector tile layer.
qgsvectortiledataitems.h
QgsWkbTypes::LineGeometry
@ LineGeometry
Definition: qgswkbtypes.h:143
QgsWkbTypes::PointGeometry
@ PointGeometry
Definition: qgswkbtypes.h:142
QgsDataProvider::Dir
@ Dir
Definition: qgsdataprovider.h:80
QgsDataItem::mPath
QString mPath
Definition: qgsdataitem.h:455
QgsProviderUtils::SublayerCompletenessFlag::IgnoreUnknownGeometryType
@ IgnoreUnknownGeometryType
Indicates that an unknown geometry type should not be considered as incomplete.
QgsDataItem::setCapabilities
virtual void setCapabilities(Qgis::BrowserItemCapabilities capabilities)
Sets the capabilities for the data item.
Definition: qgsdataitem.h:310
qgssettings.h
QgsProviderSublayerItem::QgsProviderSublayerItem
QgsProviderSublayerItem(QgsDataItem *parent, const QString &name, const QgsProviderSublayerDetails &details, const QString &filePath)
Constructor for QgsProviderSublayerItem.
Definition: qgsfilebaseddataitemprovider.cpp:38
QgsMapLayerType::VectorTileLayer
@ VectorTileLayer
Vector tile layer. Added in QGIS 3.14.
QgsWkbTypes::UnknownGeometry
@ UnknownGeometry
Definition: qgswkbtypes.h:145
QgsFileBasedDataItemProvider::name
QString name() override
Human-readable name of the provider name.
Definition: qgsfilebaseddataitemprovider.cpp:231
Qgis::BrowserLayerType::Line
@ Line
Vector line layer.
QgsWkbTypes::geometryType
static GeometryType geometryType(Type type) SIP_HOLDGIL
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a Polyg...
Definition: qgswkbtypes.h:968
QgsProviderSublayerDetails::type
QgsMapLayerType type() const
Returns the layer type.
Definition: qgsprovidersublayerdetails.h:67
QgsDataItem::children
QVector< QgsDataItem * > children() const
Definition: qgsdataitem.h:337
qgsdataprovider.h
QgsDataSourceUri::uri
QString uri(bool expandAuthConfig=true) const
Returns the complete URI as a string.
Definition: qgsdatasourceuri.cpp:540
QgsLayerItem
Item that represents a layer that can be opened with one of the providers.
Definition: qgslayeritem.h:29
QgsProviderSublayerDetails::wkbType
QgsWkbTypes::Type wkbType() const
Returns the layer's WKB type, or QgsWkbTypes::Unknown if the WKB type is not application or unknown.
Definition: qgsprovidersublayerdetails.h:218
Qgis::BrowserLayerType::Raster
@ Raster
Raster layer.
Qgis::BrowserLayerType::Point
@ Point
Vector point layer.
QgsDataItem::capabilities2
virtual Qgis::BrowserItemCapabilities capabilities2() const
Returns the capabilities for the data item.
Definition: qgsdataitem.h:303
Qgis::SublayerQueryFlag::ResolveGeometryType
@ ResolveGeometryType
Attempt to resolve the geometry type for vector sublayers.
qgszipitem.h
Qgis::BrowserLayerType::TableLayer
@ TableLayer
Vector non-spatial layer.
qgslogger.h
qgsprovidersublayerdetails.h
QgsFileBasedDataItemProvider::createDataItem
QgsDataItem * createDataItem(const QString &path, QgsDataItem *parentItem) override
Create a new instance of QgsDataItem (or nullptr) for given path and parent item.
Definition: qgsfilebaseddataitemprovider.cpp:241
Qgis::BrowserItemCapability::Fast
@ Fast
CreateChildren() is fast enough to be run in main thread when refreshing items, most root items (wms,...
QgsFileDataCollectionItem::createChildren
QVector< QgsDataItem * > createChildren() override
Create children.
Definition: qgsfilebaseddataitemprovider.cpp:140
QgsProviderSublayerItem::createChildren
QVector< QgsDataItem * > createChildren() override
Create children.
Definition: qgsfilebaseddataitemprovider.cpp:49
QgsFileBasedDataItemProvider::capabilities
int capabilities() const override
Returns combination of flags from QgsDataProvider::DataCapabilities.
Definition: qgsfilebaseddataitemprovider.cpp:236
QgsDataItem
Base class for all items in the model.
Definition: qgsdataitem.h:45
QgsMapLayerType::PointCloudLayer
@ PointCloudLayer
Point cloud layer. Added in QGIS 3.18.
QgsProviderRegistry::instance
static QgsProviderRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
Definition: qgsproviderregistry.cpp:73
QgsProviderSublayerItem::layerName
QString layerName() const override
Definition: qgsfilebaseddataitemprovider.cpp:116
QgsAbstractDatabaseProviderConnection
The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
Definition: qgsabstractdatabaseproviderconnection.h:44
Qgis::BrowserItemCapability::Fertile
@ Fertile
Can create children. Even items without this capability may have children, but cannot create them,...
QgsMapLayerType::PluginLayer
@ PluginLayer
Plugin based layer.
Qgis::BrowserLayerType::Polygon
@ Polygon
Vector polygon layer.
Qgis::BrowserLayerType::Vector
@ Vector
Generic vector layer.