QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
QgsFileBasedDataItemProvider Class Reference

A data item provider for file based data sources. More...

#include <qgsfilebaseddataitemprovider.h>

Inheritance diagram for QgsFileBasedDataItemProvider:
Inheritance graph
[legend]

Public Member Functions

Qgis::DataItemProviderCapabilities capabilities () const override
 Returns combination of flags from QgsDataProvider::DataCapabilities.
 
QgsDataItemcreateDataItem (const QString &path, QgsDataItem *parentItem) override
 Create a new instance of QgsDataItem (or nullptr) for given path and parent item.
 
bool handlesDirectoryPath (const QString &path) override
 Returns true if the provider will handle the directory at the specified path.
 
QString name () override
 Human-readable name of the provider name.
 
- Public Member Functions inherited from QgsDataItemProvider
virtual ~QgsDataItemProvider ()=default
 
virtual QVector< QgsDataItem * > createDataItems (const QString &path, QgsDataItem *parentItem)
 Create a vector of instances of QgsDataItem (or nullptr) for given path and parent item.
 
virtual QString dataProviderKey () const
 Returns the data provider key (if the data item provider is associated with a data provider), the default implementation returns an empty string.
 

Static Public Member Functions

static QgsDataItemcreateLayerItemForPath (const QString &path, QgsDataItem *parentItem, const QStringList &providers, const QVariantMap &extraUriParts, Qgis::SublayerQueryFlags queryFlags)
 Static method to create a data item for sublayers corresponding to a file-like path.
 

Detailed Description

A data item provider for file based data sources.

This is a generic data item provider, which creates data items for file based data sources from registered providers (using the QgsProviderRegistry::querySublayers() API).

Since
QGIS 3.22

Definition at line 206 of file qgsfilebaseddataitemprovider.h.

Member Function Documentation

◆ capabilities()

Qgis::DataItemProviderCapabilities QgsFileBasedDataItemProvider::capabilities ( ) const
overridevirtual

Returns combination of flags from QgsDataProvider::DataCapabilities.

Implements QgsDataItemProvider.

Definition at line 554 of file qgsfilebaseddataitemprovider.cpp.

◆ createDataItem()

QgsDataItem * QgsFileBasedDataItemProvider::createDataItem ( const QString &  path,
QgsDataItem parentItem 
)
overridevirtual

Create a new instance of QgsDataItem (or nullptr) for given path and parent item.

Caller takes responsibility of deleting created items.

Implements QgsDataItemProvider.

Definition at line 559 of file qgsfilebaseddataitemprovider.cpp.

◆ createLayerItemForPath()

QgsDataItem * QgsFileBasedDataItemProvider::createLayerItemForPath ( const QString &  path,
QgsDataItem parentItem,
const QStringList &  providers,
const QVariantMap &  extraUriParts,
Qgis::SublayerQueryFlags  queryFlags 
)
static

Static method to create a data item for sublayers corresponding to a file-like path.

Parameters
pathfile like path to create item for
parentItemparent data item
providerslist of data providers to include when scanning for sublayers for the path. Must be populated.
extraUriPartsmap of optional extra components to append to URIs generated for the path. The provider-specific encodeUri methods will be used to handle these URI additions.
queryFlagsflags controlling sublayer querying
Returns
data item, if path corresponds to a layer or an item with multiple sublayers
Since
QGIS 3.40

Definition at line 564 of file qgsfilebaseddataitemprovider.cpp.

◆ handlesDirectoryPath()

bool QgsFileBasedDataItemProvider::handlesDirectoryPath ( const QString &  path)
overridevirtual

Returns true if the provider will handle the directory at the specified path.

If the provider indicates that it will handle the directory, the default creation and population of directory items for the path will be avoided and it is left to the provider to correctly populate relevant entries for the path.

The default implementation returns false for all paths.

Reimplemented from QgsDataItemProvider.

Definition at line 682 of file qgsfilebaseddataitemprovider.cpp.

◆ name()

QString QgsFileBasedDataItemProvider::name ( )
overridevirtual

Human-readable name of the provider name.

Implements QgsDataItemProvider.

Definition at line 549 of file qgsfilebaseddataitemprovider.cpp.


The documentation for this class was generated from the following files: