QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
A registry / canonical manager of data providers. More...
#include <qgsproviderregistry.h>
Classes | |
class | ProviderCandidateDetails |
Contains information pertaining to a candidate provider. More... | |
class | UnusableUriDetails |
Contains information about unusable URIs which aren't handled by any registered providers. More... | |
class | UnusableUriHandlerInterface |
An interface used to handle unusable URIs which aren't handled by any registered providers, and construct user-friendly warnings as to why the URI is unusable. More... | |
Public Types | |
typedef std::map< QString, QgsProviderMetadata * > | Providers |
Type for data provider metadata associative container. | |
enum | WidgetMode { Standalone , Embedded , Manager } |
Different ways a source select dialog can be used. More... | |
Public Member Functions | |
~QgsProviderRegistry () | |
QString | absoluteToRelativeUri (const QString &providerKey, const QString &uri, const QgsReadWriteContext &context) const |
Converts absolute path(s) to relative path(s) in the given provider-specific URI. | |
bool | createDb (const QString &providerKey, const QString &dbPath, QString &errCause) |
Creates database by the provider on the path. | |
Qgis::VectorExportResult | createEmptyLayer (const QString &providerKey, const QString &uri, const QgsFields &fields, Qgis::WkbType wkbType, const QgsCoordinateReferenceSystem &srs, bool overwrite, QMap< int, int > &oldToNewAttrIdxMap, QString &errorMessage, const QMap< QString, QVariant > *options) |
Creates new empty vector layer. | |
QgsDataProvider * | createProvider (const QString &providerKey, const QString &dataSource, const QgsDataProvider::ProviderOptions &options=QgsDataProvider::ProviderOptions(), Qgis::DataProviderReadFlags flags=Qgis::DataProviderReadFlags()) |
Creates a new instance of a provider. | |
Q_DECL_DEPRECATED QLibrary * | createProviderLibrary (const QString &providerKey) const |
Returns a new QLibrary for the specified providerKey. | |
QgsRasterDataProvider * | createRasterDataProvider (const QString &providerKey, const QString &uri, const QString &format, int nBands, Qgis::DataType type, int width, int height, double *geoTransform, const QgsCoordinateReferenceSystem &crs, const QStringList &createOptions=QStringList()) |
Creates new instance of raster data provider. | |
Q_DECL_DEPRECATED QWidget * | createSelectionWidget (const QString &providerKey, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), QgsProviderRegistry::WidgetMode widgetMode=QgsProviderRegistry::WidgetMode::Standalone) |
Returns a new widget for selecting layers from a provider. | |
QgsTransaction * | createTransaction (const QString &providerKey, const QString &connString) |
Returns new instance of transaction. | |
QString | databaseDrivers () const |
Returns a string containing the available database drivers. | |
QList< QgsDataItemProvider * > | dataItemProviders (const QString &providerKey) const |
Returns list of data item providers of the provider. | |
QVariantMap | decodeUri (const QString &providerKey, const QString &uri) |
Breaks a provider data source URI into its component paths (e.g. | |
bool | deleteStyleById (const QString &providerKey, const QString &uri, const QString &styleId, QString &errCause) |
Deletes a layer style defined by styleId. | |
QString | directoryDrivers () const |
Returns a string containing the available directory drivers. | |
QString | encodeUri (const QString &providerKey, const QVariantMap &parts) |
Reassembles a provider data source URI from its component paths (e.g. | |
QString | fileMeshDatasetFilters () const |
Returns a file filter string for supported mesh dataset files. | |
QString | fileMeshFilters () const |
Returns a file filter string for supported mesh files. | |
QString | filePointCloudFilters () const |
Returns a file filter string for supported point clouds. | |
QString | fileRasterFilters () const |
Returns a file filter string for supported raster files. | |
QString | fileTiledSceneFilters () const |
Returns a file filter string for supported tiled scene files. | |
QString | fileVectorFilters () const |
Returns a file filter string for supported vector files. | |
QString | fileVectorTileFilters () const |
Returns a file filter string for supported vector tile files. | |
Q_DECL_DEPRECATED QFunctionPointer | function (const QString &providerKey, const QString &functionName) const |
Gets pointer to provider function. | |
QString | getStyleById (const QString &providerKey, const QString &uri, const QString &styleId, QString &errCause) |
Gets a layer style defined by styleId. | |
bool | handleUnusableUri (const QString &uri, UnusableUriDetails &details) const |
Returns true if the specified uri can potentially be handled by QGIS, if additional dependencies or build-time requirements are present. | |
Q_DECL_DEPRECATED QString | library (const QString &providerKey) const |
Returns path for the library of the provider. | |
QDir | libraryDirectory () const |
Returns the library directory where plugins are found. | |
int | listStyles (const QString &providerKey, const QString &uri, QStringList &ids, QStringList &names, QStringList &descriptions, QString &errCause) |
Lists stored layer styles in the provider defined by providerKey and uri. | |
QString | loadStoredStyle (const QString &providerKey, const QString &uri, QString &styleName, QString &errCause) |
Loads a layer style from the provider storage, reporting its name. | |
QString | loadStyle (const QString &providerKey, const QString &uri, QString &errCause) |
Loads a layer style defined by uri. | |
QString | pluginList (bool asHtml=false) const |
Returns list of provider plugins found. | |
QList< QgsProviderRegistry::ProviderCandidateDetails > | preferredProvidersForUri (const QString &uri) const |
Returns the details for the preferred provider(s) for opening the specified uri. | |
QString | protocolDrivers () const |
Returns a string containing the available protocol drivers. | |
Q_DECL_DEPRECATED Qgis::DataItemProviderCapabilities | providerCapabilities (const QString &providerKey) const |
Returns the provider capabilities. | |
QStringList | providerList () const |
Returns list of available providers by their keys. | |
QgsProviderMetadata * | providerMetadata (const QString &providerKey) const |
Returns metadata of the provider or nullptr if not found. | |
QSet< QString > | providersForLayerType (Qgis::LayerType type) const |
Returns a list of the provider keys for available providers which handle the specified layer type. | |
QList< QPair< QString, QString > > | pyramidResamplingMethods (const QString &providerKey) |
Returns list of raster pyramid resampling methods. | |
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 handled by any registered data provider. | |
Q_DECL_DEPRECATED void | registerGuis (QWidget *widget) |
bool | registerProvider (QgsProviderMetadata *providerMetadata) |
register a new vector data provider from its providerMetadata | |
bool | registerUnusableUriHandler (UnusableUriHandlerInterface *handler) |
Registers an unusable URI handler, used to handle unusable URIs which aren't handled by any registered providers, and construct user-friendly warnings as to why the URI is unusable. | |
QString | relativeToAbsoluteUri (const QString &providerKey, const QString &uri, const QgsReadWriteContext &context) const |
Converts relative path(s) to absolute path(s) in the given provider-specific URI. | |
bool | saveLayerMetadata (const QString &providerKey, const QString &uri, const QgsLayerMetadata &metadata, QString &errorMessage) |
Saves metadata to the layer corresponding to the specified uri. | |
bool | saveStyle (const QString &providerKey, const QString &uri, const QString &qmlStyle, const QString &sldStyle, const QString &styleName, const QString &styleDescription, const QString &uiFileContent, bool useAsDefault, QString &errCause) |
Saves a layer style to provider. | |
void | setLibraryDirectory (const QDir &path) |
Sets library directory where to search for plugins. | |
bool | shouldDeferUriForOtherProviders (const QString &uri, const QString &providerKey) const |
Returns true if the provider with matching providerKey should defer handling of the specified uri to another provider. | |
bool | styleExists (const QString &providerKey, const QString &uri, const QString &styleId, QString &errorCause) |
Returns true if a layer style with the specified styleId exists in the provider defined by providerKey and uri. | |
bool | uriIsBlocklisted (const QString &uri) const |
Returns true if the specified uri is known by any registered provider to be something which should be blocklisted from the QGIS interface, e.g. | |
Static Public Member Functions | |
static QgsProviderRegistry * | instance (const QString &pluginPath=QString()) |
Means of accessing canonical single instance. | |
Friends | |
class | QgsApplication |
A registry / canonical manager of data providers.
This is a Singleton class that manages data provider access.
Providers can be either loaded via libraries or native providers that are included in the core QGIS installation and accessed through function pointers.
Loaded providers may be restricted using QGIS_PROVIDER_FILE environment variable. QGIS_PROVIDER_FILE is regexp pattern applied to provider file name (not provider key). For example, if the variable is set to gdal|ogr|postgres it will load only providers gdal, ogr and postgres.
Definition at line 57 of file qgsproviderregistry.h.
typedef std::map<QString, QgsProviderMetadata *> QgsProviderRegistry::Providers |
Type for data provider metadata associative container.
Definition at line 747 of file qgsproviderregistry.h.
Different ways a source select dialog can be used.
Enumerator | |
---|---|
Standalone | Basic mode when the widget is used as a standalone dialog. Originally used as GUI for individual "Add XXX layer" buttons in the main window. Likely not used in live code anymore. |
Embedded | Used for the data source manager dialog where the widget is embedded as the main content for a particular tab. |
Manager | Used by data items for QgsDataItem::paramWidget(). Originally used by QGIS Browser, but does not seem to be in live code anymore. The mode was meant to avoid some actions to keep the browser interface simple (supposedly). |
Definition at line 67 of file qgsproviderregistry.h.
QgsProviderRegistry::~QgsProviderRegistry | ( | ) |
Definition at line 550 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::absoluteToRelativeUri | ( | const QString & | providerKey, |
const QString & | uri, | ||
const QgsReadWriteContext & | context | ||
) | const |
Converts absolute path(s) to relative path(s) in the given provider-specific URI.
and returns modified URI according to the context object's configuration. This is commonly used when writing project files. If a provider does not work with paths, unmodified URI will be returned.
Definition at line 673 of file qgsproviderregistry.cpp.
bool QgsProviderRegistry::createDb | ( | const QString & | providerKey, |
const QString & | dbPath, | ||
QString & | errCause | ||
) |
Creates database by the provider on the path.
Definition at line 852 of file qgsproviderregistry.cpp.
Qgis::VectorExportResult QgsProviderRegistry::createEmptyLayer | ( | const QString & | providerKey, |
const QString & | uri, | ||
const QgsFields & | fields, | ||
Qgis::WkbType | wkbType, | ||
const QgsCoordinateReferenceSystem & | srs, | ||
bool | overwrite, | ||
QMap< int, int > & | oldToNewAttrIdxMap, | ||
QString & | errorMessage, | ||
const QMap< QString, QVariant > * | options | ||
) |
Creates new empty vector layer.
Definition at line 691 of file qgsproviderregistry.cpp.
QgsDataProvider * QgsProviderRegistry::createProvider | ( | const QString & | providerKey, |
const QString & | dataSource, | ||
const QgsDataProvider::ProviderOptions & | options = QgsDataProvider::ProviderOptions() , |
||
Qgis::DataProviderReadFlags | flags = Qgis::DataProviderReadFlags() |
||
) |
Creates a new instance of a provider.
providerKey | identifier of the provider |
dataSource | string containing data source for the provider |
options | provider options |
flags | provider flags since QGIS 3.16 |
nullptr
on errorDefinition at line 626 of file qgsproviderregistry.cpp.
QLibrary * QgsProviderRegistry::createProviderLibrary | ( | const QString & | providerKey | ) | const |
Returns a new QLibrary for the specified providerKey.
Ownership of the returned object is transferred to the caller and the caller is responsible for deleting it.
If the provider uses direct provider function pointers instead of a library nullptr
will be returned.
Definition at line 908 of file qgsproviderregistry.cpp.
QgsRasterDataProvider * QgsProviderRegistry::createRasterDataProvider | ( | const QString & | providerKey, |
const QString & | uri, | ||
const QString & | format, | ||
int | nBands, | ||
Qgis::DataType | type, | ||
int | width, | ||
int | height, | ||
double * | geoTransform, | ||
const QgsCoordinateReferenceSystem & | crs, | ||
const QStringList & | createOptions = QStringList() |
||
) |
Creates new instance of raster data provider.
Definition at line 710 of file qgsproviderregistry.cpp.
QWidget * QgsProviderRegistry::createSelectionWidget | ( | const QString & | providerKey, |
QWidget * | parent = nullptr , |
||
Qt::WindowFlags | fl = Qt::WindowFlags() , |
||
QgsProviderRegistry::WidgetMode | widgetMode = QgsProviderRegistry::WidgetMode::Standalone |
||
) |
Returns a new widget for selecting layers from a provider.
Either the parent widget must be set or the caller becomes responsible for deleting the returned widget.
Definition at line 873 of file qgsproviderregistry.cpp.
QgsTransaction * QgsProviderRegistry::createTransaction | ( | const QString & | providerKey, |
const QString & | connString | ||
) |
Returns new instance of transaction.
Ownership is transferred to the caller
Definition at line 864 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::databaseDrivers | ( | ) | const |
Returns a string containing the available database drivers.
Definition at line 991 of file qgsproviderregistry.cpp.
QList< QgsDataItemProvider * > QgsProviderRegistry::dataItemProviders | ( | const QString & | providerKey | ) | const |
Returns list of data item providers of the provider.
Definition at line 731 of file qgsproviderregistry.cpp.
QVariantMap QgsProviderRegistry::decodeUri | ( | const QString & | providerKey, |
const QString & | uri | ||
) |
Breaks a provider data source URI into its component paths (e.g.
file path, layer name).
providerKey | identifier of the provider |
uri | uri string |
Definition at line 655 of file qgsproviderregistry.cpp.
bool QgsProviderRegistry::deleteStyleById | ( | const QString & | providerKey, |
const QString & | uri, | ||
const QString & | styleId, | ||
QString & | errCause | ||
) |
Deletes a layer style defined by styleId.
Definition at line 785 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::directoryDrivers | ( | ) | const |
Returns a string containing the available directory drivers.
Definition at line 996 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::encodeUri | ( | const QString & | providerKey, |
const QVariantMap & | parts | ||
) |
Reassembles a provider data source URI from its component paths (e.g.
file path, layer name).
providerKey | identifier of the provider |
parts | parts as returned by decodeUri |
Definition at line 664 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::fileMeshDatasetFilters | ( | ) | const |
Returns a file filter string for supported mesh dataset files.
Returns a string suitable for a QFileDialog of mesh datasets file formats supported by all data providers.
Definition at line 971 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::fileMeshFilters | ( | ) | const |
Returns a file filter string for supported mesh files.
Returns a string suitable for a QFileDialog of mesh file formats supported by all data providers.
Definition at line 966 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::filePointCloudFilters | ( | ) | const |
Returns a file filter string for supported point clouds.
Returns a string suitable for a QFileDialog of point cloud file formats supported by all data providers.
Definition at line 976 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::fileRasterFilters | ( | ) | const |
Returns a file filter string for supported raster files.
Returns a string suitable for a QFileDialog of raster file formats supported by all data providers.
Definition at line 961 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::fileTiledSceneFilters | ( | ) | const |
Returns a file filter string for supported tiled scene files.
Returns a string suitable for a QFileDialog of tiled scene file formats supported by all data providers.
Definition at line 986 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::fileVectorFilters | ( | ) | const |
Returns a file filter string for supported vector files.
Returns a string suitable for a QFileDialog of vector file formats supported by all data providers.
Definition at line 956 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::fileVectorTileFilters | ( | ) | const |
Returns a file filter string for supported vector tile files.
Returns a string suitable for a QFileDialog of vector tile file formats supported by all data providers.
Definition at line 981 of file qgsproviderregistry.cpp.
QFunctionPointer QgsProviderRegistry::function | ( | const QString & | providerKey, |
const QString & | functionName | ||
) | const |
Gets pointer to provider function.
providerKey | identifier of the provider |
functionName | name of function |
nullptr
on error. If the provider uses direct provider function pointers instead of a library nullptr
will be returned.Definition at line 884 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::getStyleById | ( | const QString & | providerKey, |
const QString & | uri, | ||
const QString & | styleId, | ||
QString & | errCause | ||
) |
Gets a layer style defined by styleId.
Definition at line 770 of file qgsproviderregistry.cpp.
bool QgsProviderRegistry::handleUnusableUri | ( | const QString & | uri, |
UnusableUriDetails & | details | ||
) | const |
Returns true
if the specified uri can potentially be handled by QGIS, if additional dependencies or build-time requirements are present.
This can be used to show user-friendly warning messages advising them why a particular uri cannot be opened on their QGIS install. For example, if a QGIS install is built without the PDAL library then las/laz files are unusable, and this method can be used to retrieve a user-friendly warning as to why the las/laz files cannot be used on their QGIS build.
uri | URI to test |
details | will be populated with details allowing construction of a user-friendly warning message |
true
if the uri was matched to a registered QgsProviderRegistry::UnusableUriHandlerInterface.Definition at line 1064 of file qgsproviderregistry.cpp.
|
static |
Means of accessing canonical single instance.
Definition at line 83 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::library | ( | const QString & | providerKey | ) | const |
Returns path for the library of the provider.
If the provider uses direct provider function pointers instead of a library an empty string will be returned.
Definition at line 559 of file qgsproviderregistry.cpp.
QDir QgsProviderRegistry::libraryDirectory | ( | ) | const |
Returns the library directory where plugins are found.
Definition at line 613 of file qgsproviderregistry.cpp.
int QgsProviderRegistry::listStyles | ( | const QString & | providerKey, |
const QString & | uri, | ||
QStringList & | ids, | ||
QStringList & | names, | ||
QStringList & | descriptions, | ||
QString & | errCause | ||
) |
Lists stored layer styles in the provider defined by providerKey and uri.
Definition at line 740 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::loadStoredStyle | ( | const QString & | providerKey, |
const QString & | uri, | ||
QString & | styleName, | ||
QString & | errCause | ||
) |
Loads a layer style from the provider storage, reporting its name.
providerKey | name of the data provider |
uri | data source uri |
styleName | the name of the style if available, empty otherwise |
errCause | report errors |
Definition at line 828 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::loadStyle | ( | const QString & | providerKey, |
const QString & | uri, | ||
QString & | errCause | ||
) |
Loads a layer style defined by uri.
Definition at line 815 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::pluginList | ( | bool | asHtml = false | ) | const |
Returns list of provider plugins found.
Definition at line 573 of file qgsproviderregistry.cpp.
QList< QgsProviderRegistry::ProviderCandidateDetails > QgsProviderRegistry::preferredProvidersForUri | ( | const QString & | uri | ) | const |
Returns the details for the preferred provider(s) for opening the specified uri.
The preferred provider is determined by comparing the priority returned by QgsProviderMetadata::priorityForUri() for all registered providers, and selecting the provider with the largest non-zero priority.
An empty list may be returned, which indicates that no providers are available which returned a non-zero priority for the specified URI.
In the case that multiple providers returned the same priority for the URI then all of these providers will be returned.
Definition at line 1032 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::protocolDrivers | ( | ) | const |
Returns a string containing the available protocol drivers.
Definition at line 1001 of file qgsproviderregistry.cpp.
Qgis::DataItemProviderCapabilities QgsProviderRegistry::providerCapabilities | ( | const QString & | providerKey | ) | const |
Returns the provider capabilities.
providerKey | identifier of the provider |
Definition at line 643 of file qgsproviderregistry.cpp.
QStringList QgsProviderRegistry::providerList | ( | ) | const |
Returns list of available providers by their keys.
Definition at line 1006 of file qgsproviderregistry.cpp.
QgsProviderMetadata * QgsProviderRegistry::providerMetadata | ( | const QString & | providerKey | ) | const |
Returns metadata of the provider or nullptr
if not found.
Definition at line 1016 of file qgsproviderregistry.cpp.
QSet< QString > QgsProviderRegistry::providersForLayerType | ( | Qgis::LayerType | type | ) | const |
Returns a list of the provider keys for available providers which handle the specified layer type.
Definition at line 1021 of file qgsproviderregistry.cpp.
QList< QPair< QString, QString > > QgsProviderRegistry::pyramidResamplingMethods | ( | const QString & | providerKey | ) |
Returns list of raster pyramid resampling methods.
Definition at line 722 of file qgsproviderregistry.cpp.
QList< QgsProviderSublayerDetails > QgsProviderRegistry::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 handled by any registered data provider.
This method iteratively queries each registered data provider and returns the complete collated list of all valid sublayers found in the dataset which can be opened by the data providers.
The optional flags argument can be used to control the behavior of the query.
The optional feedback argument can be used to provide cancellation support for long-running queries.
Definition at line 1101 of file qgsproviderregistry.cpp.
void QgsProviderRegistry::registerGuis | ( | QWidget * | widget | ) |
Definition at line 928 of file qgsproviderregistry.cpp.
bool QgsProviderRegistry::registerProvider | ( | QgsProviderMetadata * | providerMetadata | ) |
register a new vector data provider from its providerMetadata
true
on success, false
if a provider with the same key was already registered Definition at line 933 of file qgsproviderregistry.cpp.
bool QgsProviderRegistry::registerUnusableUriHandler | ( | QgsProviderRegistry::UnusableUriHandlerInterface * | handler | ) |
Registers an unusable URI handler, used to handle unusable URIs which aren't handled by any registered providers, and construct user-friendly warnings as to why the URI is unusable.
true
on successDefinition at line 1058 of file qgsproviderregistry.cpp.
QString QgsProviderRegistry::relativeToAbsoluteUri | ( | const QString & | providerKey, |
const QString & | uri, | ||
const QgsReadWriteContext & | context | ||
) | const |
Converts relative path(s) to absolute path(s) in the given provider-specific URI.
and returns modified URI according to the context object's configuration. This is commonly used when reading project files. If a provider does not work with paths, unmodified URI will be returned.
Definition at line 682 of file qgsproviderregistry.cpp.
bool QgsProviderRegistry::saveLayerMetadata | ( | const QString & | providerKey, |
const QString & | uri, | ||
const QgsLayerMetadata & | metadata, | ||
QString & | errorMessage | ||
) |
Saves metadata to the layer corresponding to the specified uri.
providerKey | identifier of the provider |
uri | uri of layer to store metadata for |
metadata | layer metadata |
errorMessage | descriptive string of error if encountered |
true
if the metadata was successfully saved.QgsNotSupportedException | if the provider does not support saving layer metadata for the specified uri. |
Definition at line 841 of file qgsproviderregistry.cpp.
bool QgsProviderRegistry::saveStyle | ( | const QString & | providerKey, |
const QString & | uri, | ||
const QString & | qmlStyle, | ||
const QString & | sldStyle, | ||
const QString & | styleName, | ||
const QString & | styleDescription, | ||
const QString & | uiFileContent, | ||
bool | useAsDefault, | ||
QString & | errCause | ||
) |
Saves a layer style to provider.
Definition at line 799 of file qgsproviderregistry.cpp.
void QgsProviderRegistry::setLibraryDirectory | ( | const QDir & | path | ) |
Sets library directory where to search for plugins.
Definition at line 606 of file qgsproviderregistry.cpp.
bool QgsProviderRegistry::shouldDeferUriForOtherProviders | ( | const QString & | uri, |
const QString & | providerKey | ||
) | const |
Returns true
if the provider with matching providerKey should defer handling of the specified uri to another provider.
This method tests whether any providers are listed as the preferred provider for uri (see preferredProvidersForUri()), and if so tests whether the specified provider is included in that preferred providers list. Returns true
only if the specified provider is calculated as one of the preferred providers for the URI.
In the case that there is no registered preferred provider for the URI then false
will be returned, and the provider must use another metric to determine whether it should handle the URI.
Definition at line 1077 of file qgsproviderregistry.cpp.
bool QgsProviderRegistry::styleExists | ( | const QString & | providerKey, |
const QString & | uri, | ||
const QString & | styleId, | ||
QString & | errorCause | ||
) |
Returns true
if a layer style with the specified styleId exists in the provider defined by providerKey and uri.
providerKey | provider key |
uri | provider URI |
styleId | style ID to test for |
errorCause | will be set to a descriptive error message, if an error occurs while checking if the style exists |
true
if the layer style already existsDefinition at line 755 of file qgsproviderregistry.cpp.
bool QgsProviderRegistry::uriIsBlocklisted | ( | const QString & | uri | ) | const |
Returns true
if the specified uri is known by any registered provider to be something which should be blocklisted from the QGIS interface, e.g.
an internal detail only.
Specifically, this method can be utilized by the browser panel to hide noisy internal details for URIs which are known to be sidecar files only, such as ".aux.xml" files or ".shp.xml" files, or the "ept-build.json" files which sit alongside Entwine "ept.json" point cloud sources.
This method tests whether any of the registered providers return true
for the their QgsProviderMetadata::uriIsBlocklisted() implementation for the specified URI.
Definition at line 1091 of file qgsproviderregistry.cpp.
|
friend |
Definition at line 839 of file qgsproviderregistry.h.