32#include "providers/gdal/qgsgdalprovider.h"
33#include "providers/ogr/qgsogrprovidermetadata.h"
34#include "providers/ogr/qgsogrprovider.h"
35#include "providers/meshmemory/qgsmeshmemorydataprovider.h"
47#include "providers/ept/qgseptprovider.h"
51#include "providers/copc/qgscopcprovider.h"
52#include "providers/vpc/qgsvirtualpointcloudprovider.h"
58#ifdef HAVE_STATIC_PROVIDERS
59#include "qgswmsprovider.h"
60#include "qgswcsprovider.h"
61#include "qgsdelimitedtextprovider.h"
62#include "qgsafsprovider.h"
63#include "qgsamsprovider.h"
65#include "qgsspatialiteprovider.h"
66#include "qgswfsprovider.h"
67#include "qgswfsprovidermetadata.h"
68#include "qgsoapifprovider.h"
69#include "qgsvirtuallayerprovider.h"
72#include "qgspostgresprovider.h"
79#include <QRegularExpression>
88 const QMutexLocker locker( &sMutex );
108 const QString &providerKey )
111 const QgsProviderRegistry::Providers::const_iterator i =
112 metaData.find( providerKey );
114 if ( i != metaData.end() )
120 for (
auto it = metaData.begin(); it != metaData.end(); ++it )
122 if ( providerKey.compare( it->first, Qt::CaseInsensitive ) == 0 )
129QgsProviderRegistry::QgsProviderRegistry(
const QString &pluginPath )
137 char **argv = qApp->argv();
138 QString appDir = argv[0];
139 int bin = appDir.findRev(
"/bin", -1,
false );
140 QString baseDir = appDir.left( bin );
141 QString mLibraryDirectory = baseDir +
"/lib";
145 mLibraryDirectory.setPath( pluginPath );
153 bool matchesUri(
const QString &uri )
const override
155 const QFileInfo fi( uri );
156 if ( fi.suffix().compare( QLatin1String(
"las" ), Qt::CaseInsensitive ) == 0 || fi.suffix().compare( QLatin1String(
"laz" ), Qt::CaseInsensitive ) == 0 )
165 QObject::tr(
"LAS and LAZ files cannot be opened by this QGIS install." ),
169 res.
detailedWarning = QObject::tr(
"The installer used to install this version of QGIS does "
170 "not include the PDAL library required for opening LAS and LAZ point clouds. Please "
171 "obtain one of the alternative installers from https://qgis.org which has point "
172 "cloud support enabled." );
174 res.
detailedWarning = QObject::tr(
"This QGIS build does not include the PDAL library dependency required for opening LAS or LAZ point clouds." );
181void QgsProviderRegistry::init()
186 mProviders[ QgsMemoryProvider::providerKey() ] =
new QgsMemoryProviderMetadata();
190 mProviders[ QgsMeshMemoryDataProvider::providerKey() ] =
new QgsMeshMemoryProviderMetadata();
194 mProviders[ QgsGdalProvider::providerKey() ] =
new QgsGdalProviderMetadata();
198 mProviders[ QgsOgrProvider::providerKey() ] =
new QgsOgrProviderMetadata();
202 mProviders[ QgsSensorThingsProvider::providerKey() ] =
new QgsSensorThingsProviderMetadata();
207 mProviders[ vt->
key() ] = vt;
208 vt =
new QgsXyzVectorTileDataProviderMetadata();
209 mProviders[ vt->
key() ] = vt;
210 vt =
new QgsVtpkVectorTileDataProviderMetadata();
211 mProviders[ vt->
key() ] = vt;
212 vt =
new QgsArcGisVectorTileServiceDataProviderMetadata();
213 mProviders[ vt->
key() ] = vt;
214 vt =
new QgsMbTilesVectorTileDataProviderMetadata();
215 mProviders[ vt->
key() ] = vt;
221 mProviders[ pc->
key() ] = pc;
228 mProviders[ pc->
key() ] = pc;
233 mProviders[ pc->
key() ] = pc;
241 mProviders[ metadata->
key() ] = metadata;
243 metadata =
new QgsCesiumTilesProviderMetadata();
244 mProviders[ metadata->
key() ] = metadata;
246 metadata =
new QgsQuantizedMeshProviderMetadata();
247 mProviders[ metadata->
key() ] = metadata;
250#ifdef HAVE_STATIC_PROVIDERS
251 mProviders[ QgsWmsProvider::providerKey() ] =
new QgsWmsProviderMetadata();
252 mProviders[ QgsWcsProvider::providerKey() ] =
new QgsWcsProviderMetadata();
253 mProviders[ QgsDelimitedTextProvider::providerKey() ] =
new QgsDelimitedTextProviderMetadata();
254 mProviders[ QgsAfsProvider::providerKey() ] =
new QgsAfsProviderMetadata();
255 mProviders[ QgsAmsProvider::providerKey() ] =
new QgsAmsProviderMetadata();
256#ifdef HAVE_SPATIALITE
257 mProviders[ QgsSpatiaLiteProvider::providerKey() ] =
new QgsSpatiaLiteProviderMetadata();
258 mProviders[ QgsWFSProvider::providerKey() ] =
new QgsWfsProviderMetadata();
259 mProviders[ QgsOapifProvider::providerKey() ] =
new QgsOapifProviderMetadata();
260 mProviders[ QgsVirtualLayerProvider::providerKey() ] =
new QgsVirtualLayerProviderMetadata();
262#ifdef HAVE_POSTGRESQL
263 mProviders[ QgsPostgresProvider::providerKey() ] =
new QgsPostgresProviderMetadata();
268#ifdef HAVE_STATIC_PROVIDERS
273 mLibraryDirectory.setSorting( QDir::Name | QDir::IgnoreCase );
274 mLibraryDirectory.setFilter( QDir::Files | QDir::NoSymLinks );
276#if defined(Q_OS_WIN) || defined(__CYGWIN__)
277 mLibraryDirectory.setNameFilters( QStringList(
"*.dll" ) );
278#elif defined(ANDROID)
279 mLibraryDirectory.setNameFilters( QStringList(
"*provider_*.so" ) );
281 mLibraryDirectory.setNameFilters( QStringList( QStringLiteral(
"*.so" ) ) );
284 QgsDebugMsgLevel( QStringLiteral(
"Checking %1 for provider plugins" ).arg( mLibraryDirectory.path() ), 2 );
286 if ( mLibraryDirectory.count() == 0 )
288 QgsDebugError( QStringLiteral(
"No dynamic QGIS data provider plugins found in:\n%1\n" ).arg( mLibraryDirectory.path() ) );
292 const QString filePattern = getenv(
"QGIS_PROVIDER_FILE" );
293 QRegularExpression fileRegexp;
294 if ( !filePattern.isEmpty() )
296 fileRegexp.setPattern( filePattern );
299 typedef std::vector<QgsProviderMetadata *> *multiple_factory_function();
301 const auto constEntryInfoList = mLibraryDirectory.entryInfoList();
302 for (
const QFileInfo &fi : constEntryInfoList )
304 if ( !filePattern.isEmpty() )
306 if ( fi.fileName().indexOf( fileRegexp ) == -1 )
308 QgsDebugMsgLevel(
"provider " + fi.fileName() +
" skipped because doesn't match pattern " + filePattern, 2 );
314 if ( fi.fileName().contains( QStringLiteral(
"authmethod" ), Qt::CaseSensitivity::CaseInsensitive ) )
320 QLibrary myLib( fi.filePath() );
323 QgsDebugError( QStringLiteral(
"Checking %1: ...invalid (lib not loadable): %2" ).arg( myLib.fileName(), myLib.errorString() ) );
327 bool libraryLoaded {
false };
328 QFunctionPointer func = myLib.resolve( QStringLiteral(
"providerMetadataFactory" ).toLatin1().data() );
335 if ( findMetadata_( mProviders, meta->
key() ) )
337 QgsDebugError( QStringLiteral(
"Checking %1: ...invalid (key %2 already registered)" ).arg( myLib.fileName() ).arg( meta->
key() ) );
342 mProviders[meta->
key()] = meta;
343 libraryLoaded =
true;
348 QFunctionPointer multi_func = myLib.resolve( QStringLiteral(
"multipleProviderMetadataFactory" ).toLatin1().data() );
349 multiple_factory_function *multi_function =
reinterpret_cast< multiple_factory_function *
>(
cast_to_fptr( multi_func ) );
350 if ( multi_function )
352 std::vector<QgsProviderMetadata *> *metadatas = multi_function();
353 for (
const auto meta : *metadatas )
355 if ( findMetadata_( mProviders, meta->
key() ) )
357 QgsDebugError( QStringLiteral(
"Checking %1: ...invalid (key %2 already registered)" ).arg( myLib.fileName() ).arg( meta->
key() ) );
362 mProviders[meta->
key()] = meta;
363 libraryLoaded =
true;
369 if ( ! libraryLoaded )
371 QgsDebugMsgLevel( QStringLiteral(
"Checking %1: ...invalid (no providerMetadataFactory method)" ).arg( myLib.fileName() ), 2 );
379 for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); ++it )
381 const QString &key = it->first;
391 rebuildFilterStrings();
394 mDatabaseDrivers = QgsOgrProviderUtils::databaseDrivers();
397 mDirectoryDrivers = QgsOgrProviderUtils::directoryDrivers();
400 mProtocolDrivers = QgsOgrProviderUtils::protocolDrivers();
403void QgsProviderRegistry::rebuildFilterStrings()
405 mVectorFileFilters.clear();
406 mRasterFileFilters.clear();
407 mMeshFileFilters.clear();
408 mMeshDatasetFileFilters.clear();
409 mPointCloudFileFilters.clear();
410 mVectorTileFileFilters.clear();
411 mTiledSceneFileFilters.clear();
413 QStringList pointCloudWildcards;
414 QStringList pointCloudFilters;
416 QStringList vectorTileWildcards;
417 QStringList vectorTileFilters;
419 QStringList tiledSceneWildcards;
420 QStringList tiledSceneFilters;
422 for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); ++it )
448 QgsDebugMsgLevel( QStringLiteral(
"Checking %1: ...loaded OK (%2 file mesh filters)" ).arg( it->first ).arg( mMeshFileFilters.split(
";;" ).count() ), 2 );
456 QgsDebugMsgLevel( QStringLiteral(
"Checking %1: ...loaded OK (%2 file dataset filters)" ).arg( it->first ).arg( mMeshDatasetFileFilters.split(
";;" ).count() ), 2 );
465 const QStringList filters =
filePointCloudFilters.split( QStringLiteral(
";;" ), Qt::SkipEmptyParts );
466 for (
const QString &filter : filters )
468 pointCloudFilters.append( filter );
479 const QStringList filters =
fileVectorTileFilters.split( QStringLiteral(
";;" ), Qt::SkipEmptyParts );
480 for (
const QString &filter : filters )
482 vectorTileFilters.append( filter );
493 const QStringList filters =
fileTiledSceneFilters.split( QStringLiteral(
";;" ), Qt::SkipEmptyParts );
494 for (
const QString &filter : filters )
496 tiledSceneFilters.append( filter );
502 if ( !pointCloudFilters.empty() )
504 pointCloudFilters.insert( 0, QObject::tr(
"All Supported Files" ) + QStringLiteral(
" (%1)" ).arg( pointCloudWildcards.join(
' ' ) ) );
505 pointCloudFilters.insert( 1, QObject::tr(
"All Files" ) + QStringLiteral(
" (*.*)" ) );
506 mPointCloudFileFilters = pointCloudFilters.join( QLatin1String(
";;" ) );
509 if ( !vectorTileFilters.empty() )
511 vectorTileFilters.insert( 0, QObject::tr(
"All Supported Files" ) + QStringLiteral(
" (%1)" ).arg( vectorTileWildcards.join(
' ' ) ) );
512 vectorTileFilters.insert( 1, QObject::tr(
"All Files" ) + QStringLiteral(
" (*.*)" ) );
513 mVectorTileFileFilters = vectorTileFilters.join( QLatin1String(
";;" ) );
516 if ( !tiledSceneFilters.empty() )
518 tiledSceneFilters.insert( 0, QObject::tr(
"All Supported Files" ) + QStringLiteral(
" (%1)" ).arg( tiledSceneWildcards.join(
' ' ) ) );
519 tiledSceneFilters.insert( 1, QObject::tr(
"All Files" ) + QStringLiteral(
" (*.*)" ) );
520 mTiledSceneFileFilters = tiledSceneFilters.join( QLatin1String(
";;" ) );
527void QgsProviderRegistry::clean()
530 if ( QgsProject::sProject )
533 Providers::const_iterator it = mProviders.begin();
535 while ( it != mProviders.end() )
538 it->second->cleanupProvider();
545bool QgsProviderRegistry::exists()
547 return static_cast< bool >( sInstance );
552 qDeleteAll( mUnusableUriHandlers );
555 if ( sInstance ==
this )
575 Providers::const_iterator it = mProviders.begin();
577 if ( mProviders.empty() )
578 return QObject::tr(
"No data provider plugins are available. No vector layers can be loaded" );
583 list += QLatin1String(
"<ol>" );
585 while ( it != mProviders.end() )
588 list += QLatin1String(
"<li>" );
590 list += it->second->description();
593 list += QLatin1String(
"<br></li>" );
601 list += QLatin1String(
"</ol>" );
608 mLibraryDirectory = path;
615 return mLibraryDirectory;
645 const QList< QgsDataItemProvider * > itemProviders =
dataItemProviders( providerKey );
650 ret |= itemProvider->capabilities();
661 return QVariantMap();
696 bool overwrite, QMap<int, int> &oldToNewAttrIdxMap,
697 QString &errorMessage,
698 const QMap<QString, QVariant> *options )
702 return meta->
createEmptyLayer( uri, fields, wkbType, srs, overwrite, oldToNewAttrIdxMap, errorMessage, options );
705 errorMessage = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
713 const QStringList &createOptions )
728 return QList<QPair<QString, QString> >();
737 return QList<QgsDataItemProvider *>();
740int QgsProviderRegistry::listStyles(
const QString &providerKey,
const QString &uri, QStringList &ids, QStringList &names, QStringList &descriptions, QString &errCause )
746 res = meta->
listStyles( uri, ids, names, descriptions, errCause );
750 errCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
761 return meta->
styleExists( uri, styleId, errorCause );
765 errorCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
780 errCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
787 const bool ret(
false );
794 errCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
800 const QString &sldStyle,
const QString &styleName,
const QString &styleDescription,
801 const QString &uiFileContent,
bool useAsDefault, QString &errCause )
806 ret = meta->
saveStyle( uri, qmlStyle, sldStyle, styleName, styleDescription,
807 uiFileContent, useAsDefault, errCause );
810 errCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
823 errCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
836 errCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
843 errorMessage.clear();
856 return meta->
createDb( dbPath, errCause );
859 errCause = QStringLiteral(
"Resolving createDb(...) failed" );
876 Q_UNUSED( providerKey );
879 Q_UNUSED( widgetMode );
880 QgsDebugError(
"deprecated call - use QgsGui::sourceSelectProviderRegistry()->createDataSourceWidget() instead" );
885 QString
const &functionName )
const
888 const QString lib =
library( providerKey );
893 QLibrary myLib( lib );
899 return myLib.resolve( functionName.toLatin1().data() );
903 QgsDebugError(
"Cannot load library: " + myLib.errorString() );
911 const QString lib =
library( providerKey );
916 std::unique_ptr< QLibrary > myLib(
new QLibrary( lib ) );
921 return myLib.release();
923 QgsDebugError(
"Cannot load library: " + myLib->errorString() );
930 QgsDebugError(
"deprecated - use QgsGui::providerGuiRegistry() instead." );
941 rebuildFilterStrings();
951 QgsDebugMsgLevel( QStringLiteral(
"Trying to register a null metadata provider!" ), 2 );
958 return mVectorFileFilters;
963 return mRasterFileFilters;
968 return mMeshFileFilters;
973 return mMeshDatasetFileFilters;
978 return mPointCloudFileFilters;
983 return mVectorTileFileFilters;
988 return mTiledSceneFileFilters;
993 return mDatabaseDrivers;
998 return mDirectoryDrivers;
1003 return mProtocolDrivers;
1009 for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); ++it )
1011 lst.append( it->first );
1018 return findMetadata_( mProviders, providerKey );
1024 for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); ++it )
1026 if ( it->second->supportedLayerTypes().contains( type ) )
1027 lst.insert( it->first );
1034 QList< QgsProviderRegistry::ProviderCandidateDetails > res;
1035 int maxPriority = 0;
1036 for (
auto it = mProviders.begin(); it != mProviders.end(); ++it )
1041 const int thisProviderPriority = it->second->priorityForUri( uri );
1042 if ( thisProviderPriority == 0 )
1045 if ( thisProviderPriority > maxPriority )
1048 maxPriority = thisProviderPriority;
1050 if ( thisProviderPriority == maxPriority )
1060 mUnusableUriHandlers << handler;
1068 if ( handler->matchesUri( uri ) )
1070 details = handler->details( uri );
1080 if ( providers.empty() )
1085 if ( provider.metadata()->key() == providerKey )
1093 for (
auto it = mProviders.begin(); it != mProviders.end(); ++it )
1095 if ( it->second->uriIsBlocklisted( uri ) )
1107 QList<QgsProviderSublayerDetails> res;
1108 for (
auto it = mProviders.begin(); it != mProviders.end(); ++it )
1114 res.append( it->second->querySublayers( uri, flags, feedback ) );
@ TiledScene
Tiled scene layers.
@ VectorTile
Vector tile layers.
@ MeshDataset
Mesh datasets.
@ PointCloud
Point clouds.
VectorExportResult
Vector layer export result codes.
@ ErrorInvalidProvider
Could not find a matching provider key.
QFlags< DataItemProviderCapability > DataItemProviderCapabilities
Capabilities for data item providers.
QFlags< DataProviderReadFlag > DataProviderReadFlags
Flags which control data provider construction.
DataType
Raster data types.
QFlags< SublayerQueryFlag > SublayerQueryFlags
Sublayer query flags.
LayerType
Types of layers that can be added to a map.
@ PointCloud
Point cloud layer. Added in QGIS 3.18.
WkbType
The WKB type describes the number of dimensions a geometry has.
This class represents a coordinate reference system (CRS).
This is the interface for those who want to add custom data items to the browser tree.
Abstract base class for spatial data provider implementations.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
bool isCanceled() const
Tells whether the operation has been canceled already.
Container of fields for a vector layer.
static QString wildcardsFromFilter(const QString &filter)
Given a filter string like GeoTIFF Files (*.tiff *.tif), extracts the wildcard portion of this filter...
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
Custom exception class which is raised when an operation is not supported.
static QgsProject * instance()
Returns the QgsProject singleton instance.
void removeAllMapLayers()
Removes all registered layers.
Contains information pertaining to a candidate provider.
Contains information about unusable URIs which aren't handled by any registered providers.
QString detailedWarning
Contains a longer, user-friendly, translated message advising why the URI is not usable.
An interface used to handle unusable URIs which aren't handled by any registered providers,...
virtual UnusableUriDetails details(const QString &uri) const =0
Returns the details for advising the user why the uri is not usable.
virtual bool matchesUri(const QString &uri) const =0
Returns true if the handle is an unusable URI handler for the specified uri.
A registry / canonical manager of data providers.
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.
std::map< QString, QgsProviderMetadata * > Providers
Type for data provider metadata associative container.
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 providerKe...
QString loadStyle(const QString &providerKey, const QString &uri, QString &errCause)
Loads a layer style defined by uri.
QString getStyleById(const QString &providerKey, const QString &uri, const QString &styleId, QString &errCause)
Gets a layer style defined by styleId.
QVariantMap decodeUri(const QString &providerKey, const QString &uri)
Breaks a provider data source URI into its component paths (e.g.
void setLibraryDirectory(const QDir &path)
Sets library directory where to search for plugins.
QString fileVectorTileFilters() const
Returns a file filter string for supported vector tile files.
QgsTransaction * createTransaction(const QString &providerKey, const QString &connString)
Returns new instance of transaction.
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...
Q_DECL_DEPRECATED void registerGuis(QWidget *widget)
static QgsProviderRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
WidgetMode
Different ways a source select dialog can be used.
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.
QString protocolDrivers() const
Returns a string containing the available protocol drivers.
QList< QgsProviderRegistry::ProviderCandidateDetails > preferredProvidersForUri(const QString &uri) const
Returns the details for the preferred provider(s) for opening the specified uri.
Q_DECL_DEPRECATED QString library(const QString &providerKey) const
Returns path for the library of the provider.
QString fileTiledSceneFilters() const
Returns a file filter string for supported tiled scene files.
QString databaseDrivers() const
Returns a string containing the available database drivers.
QString encodeUri(const QString &providerKey, const QVariantMap &parts)
Reassembles a provider data source URI from its component paths (e.g.
QList< QgsDataItemProvider * > dataItemProviders(const QString &providerKey) const
Returns list of data item providers of the provider.
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.
QList< QPair< QString, QString > > pyramidResamplingMethods(const QString &providerKey)
Returns list of raster pyramid resampling methods.
bool uriIsBlocklisted(const QString &uri) const
Returns true if the specified uri is known by any registered provider to be something which should be...
Q_DECL_DEPRECATED QLibrary * createProviderLibrary(const QString &providerKey) const
Returns a new QLibrary for the specified providerKey.
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.
bool handleUnusableUri(const QString &uri, UnusableUriDetails &details) const
Returns true if the specified uri can potentially be handled by QGIS, if additional dependencies or b...
QString fileVectorFilters() const
Returns a file filter string for supported vector files.
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.
QString fileRasterFilters() const
Returns a file filter string for supported raster files.
bool saveLayerMetadata(const QString &providerKey, const QString &uri, const QgsLayerMetadata &metadata, QString &errorMessage)
Saves metadata to the layer corresponding to the specified uri.
QString fileMeshFilters() const
Returns a file filter string for supported mesh files.
QString pluginList(bool asHtml=false) const
Returns list of provider plugins found.
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 ...
bool deleteStyleById(const QString &providerKey, const QString &uri, const QString &styleId, QString &errCause)
Deletes a layer style defined by styleId.
QStringList providerList() const
Returns list of available providers by their keys.
Q_DECL_DEPRECATED Qgis::DataItemProviderCapabilities providerCapabilities(const QString &providerKey) const
Returns the provider capabilities.
QString fileMeshDatasetFilters() const
Returns a file filter string for supported mesh dataset files.
QString loadStoredStyle(const QString &providerKey, const QString &uri, QString &styleName, QString &errCause)
Loads a layer style from the provider storage, reporting its name.
QDir libraryDirectory() const
Returns the library directory where plugins are found.
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.
QgsProviderMetadata * providerMetadata(const QString &providerKey) const
Returns metadata of the provider or nullptr if not 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.
bool createDb(const QString &providerKey, const QString &dbPath, QString &errCause)
Creates database by the provider on the path.
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.
QSet< QString > providersForLayerType(Qgis::LayerType type) const
Returns a list of the provider keys for available providers which handle the specified layer type.
bool registerProvider(QgsProviderMetadata *providerMetadata)
register a new vector data provider from its providerMetadata
Q_DECL_DEPRECATED QFunctionPointer function(const QString &providerKey, const QString &functionName) const
Gets pointer to provider function.
QString directoryDrivers() const
Returns a string containing the available directory drivers.
bool registerUnusableUriHandler(UnusableUriHandlerInterface *handler)
Registers an unusable URI handler, used to handle unusable URIs which aren't handled by any registere...
QString filePointCloudFilters() const
Returns a file filter string for supported point clouds.
Base class for raster data providers.
The class is used as a container of context for various read/write operations on other objects.
Scoped object for logging of the runtime for a single operation or group of operations.
This class allows including a set of layers in a database-side transaction, provided the layer data p...
#define Q_NOWARN_DEPRECATED_POP
#define Q_NOWARN_DEPRECATED_PUSH
#define QgsDebugMsgLevel(str, level)
#define QgsDebugError(str)
void cleanupProviderFunction_t()
const QgsCoordinateReferenceSystem & crs
Setting options for creating vector data providers.