21#include "providers/gdal/qgsgdalprovider.h"
23#include "providers/meshmemory/qgsmeshmemorydataprovider.h"
24#include "providers/ogr/qgsogrprovider.h"
25#include "providers/ogr/qgsogrprovidermetadata.h"
47using namespace Qt::StringLiterals;
50#include "providers/ept/qgseptprovider.h"
54#include "providers/copc/qgscopcprovider.h"
55#include "providers/vpc/qgsvirtualpointcloudprovider.h"
61#ifdef HAVE_STATIC_PROVIDERS
62#include "qgswmsprovider.h"
63#include "qgswcsprovider.h"
64#include "qgsdelimitedtextprovider.h"
65#include "qgsafsprovider.h"
66#include "qgsamsprovider.h"
68#include "qgsspatialiteprovider.h"
69#include "qgswfsprovider.h"
70#include "qgswfsprovidermetadata.h"
71#include "qgsoapifprovider.h"
72#include "qgsvirtuallayerprovider.h"
75#include "qgspostgresprovider.h"
82#include <QRegularExpression>
91 const QMutexLocker locker( &sMutex );
94 sInstance =
new QgsProviderRegistry( pluginPath );
112 const QgsProviderRegistry::Providers::const_iterator i = 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";
144 const QgsScopedRuntimeProfile profile( QObject::tr(
"Initialize data providers" ) );
145 mLibraryDirectory.setPath( pluginPath );
153 bool matchesUri(
const QString &uri )
const override
155 const QFileInfo fi( uri );
156 if ( fi.suffix().compare(
"las"_L1, Qt::CaseInsensitive ) == 0 || fi.suffix().compare(
"laz"_L1, Qt::CaseInsensitive ) == 0 )
162 QgsProviderRegistry::UnusableUriDetails
details(
const QString &uri )
const override
164 QgsProviderRegistry::UnusableUriDetails res
165 = QgsProviderRegistry::UnusableUriDetails( uri, QObject::tr(
"LAS and LAZ files cannot be opened by this QGIS install." ), QList<Qgis::LayerType>() <<
Qgis::LayerType::PointCloud );
169 "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."
175 res.
detailedWarning = QObject::tr(
"This QGIS build does not include the PDAL library dependency required for opening LAS or LAZ point clouds." );
182void QgsProviderRegistry::init()
186 const QgsScopedRuntimeProfile profile( QObject::tr(
"Create memory layer provider" ) );
187 mProviders[QgsMemoryProvider::providerKey()] =
new QgsMemoryProviderMetadata();
190 const QgsScopedRuntimeProfile profile( QObject::tr(
"Create mesh memory layer provider" ) );
191 mProviders[QgsMeshMemoryDataProvider::providerKey()] =
new QgsMeshMemoryProviderMetadata();
194 const QgsScopedRuntimeProfile profile( QObject::tr(
"Create GDAL provider" ) );
195 mProviders[QgsGdalProvider::providerKey()] =
new QgsGdalProviderMetadata();
198 const QgsScopedRuntimeProfile profile( QObject::tr(
"Create OGR provider" ) );
199 mProviders[QgsOgrProvider::providerKey()] =
new QgsOgrProviderMetadata();
202 const QgsScopedRuntimeProfile profile( QObject::tr(
"Create OGC SensorThings API provider" ) );
203 mProviders[QgsSensorThingsProvider::providerKey()] =
new QgsSensorThingsProviderMetadata();
206 const QgsScopedRuntimeProfile profile( QObject::tr(
"Create vector tile providers" ) );
207 QgsProviderMetadata *vt =
new QgsVectorTileProviderMetadata();
208 mProviders[vt->
key()] = vt;
209 vt =
new QgsXyzVectorTileDataProviderMetadata();
210 mProviders[vt->
key()] = vt;
211 vt =
new QgsVtpkVectorTileDataProviderMetadata();
212 mProviders[vt->
key()] = vt;
213 vt =
new QgsArcGisVectorTileServiceDataProviderMetadata();
214 mProviders[vt->
key()] = vt;
215 vt =
new QgsMbTilesVectorTileDataProviderMetadata();
216 mProviders[vt->
key()] = vt;
220 const QgsScopedRuntimeProfile profile( QObject::tr(
"Create EPT point cloud provider" ) );
221 QgsProviderMetadata *pc =
new QgsEptProviderMetadata();
222 mProviders[pc->
key()] = pc;
227 const QgsScopedRuntimeProfile profile( QObject::tr(
"Create COPC point cloud provider" ) );
228 QgsProviderMetadata *pc =
new QgsCopcProviderMetadata();
229 mProviders[pc->
key()] = pc;
232 const QgsScopedRuntimeProfile profile( QObject::tr(
"Create Virtual point cloud provider" ) );
233 QgsProviderMetadata *pc =
new QgsVirtualPointCloudProviderMetadata();
234 mProviders[pc->
key()] = pc;
240 const QgsScopedRuntimeProfile profile( QObject::tr(
"Create tiled scene providers" ) );
241 QgsProviderMetadata *metadata =
new QgsTiledSceneProviderMetadata();
242 mProviders[metadata->
key()] = metadata;
244 metadata =
new QgsCesiumTilesProviderMetadata();
245 mProviders[metadata->
key()] = metadata;
247 metadata =
new QgsQuantizedMeshProviderMetadata();
248 mProviders[metadata->
key()] = metadata;
250 metadata =
new QgsEsriI3SProviderMetadata();
251 mProviders[metadata->
key()] = metadata;
254#ifdef HAVE_STATIC_PROVIDERS
255 mProviders[QgsWmsProvider::providerKey()] =
new QgsWmsProviderMetadata();
256 mProviders[QgsWcsProvider::providerKey()] =
new QgsWcsProviderMetadata();
257 mProviders[QgsDelimitedTextProvider::providerKey()] =
new QgsDelimitedTextProviderMetadata();
258 mProviders[QgsAfsProvider::providerKey()] =
new QgsAfsProviderMetadata();
259 mProviders[QgsAmsProvider::providerKey()] =
new QgsAmsProviderMetadata();
260#ifdef HAVE_SPATIALITE
261 mProviders[QgsSpatiaLiteProvider::providerKey()] =
new QgsSpatiaLiteProviderMetadata();
262 mProviders[QgsWFSProvider::providerKey()] =
new QgsWfsProviderMetadata();
263 mProviders[QgsOapifProvider::providerKey()] =
new QgsOapifProviderMetadata();
264 mProviders[QgsVirtualLayerProvider::providerKey()] =
new QgsVirtualLayerProviderMetadata();
266#ifdef HAVE_POSTGRESQL
267 mProviders[QgsPostgresProvider::providerKey()] =
new QgsPostgresProviderMetadata();
272#ifdef HAVE_STATIC_PROVIDERS
275 typedef QgsProviderMetadata *factory_function();
277 mLibraryDirectory.setSorting( QDir::Name | QDir::IgnoreCase );
278 mLibraryDirectory.setFilter( QDir::Files | QDir::NoSymLinks );
280#if defined( Q_OS_WIN ) || defined( __CYGWIN__ )
281 mLibraryDirectory.setNameFilters( QStringList(
"*.dll" ) );
282#elif defined( ANDROID )
283 mLibraryDirectory.setNameFilters( QStringList(
"*provider_*.so" ) );
285 mLibraryDirectory.setNameFilters( QStringList( u
"*.so"_s ) );
288 QgsDebugMsgLevel( u
"Checking %1 for provider plugins"_s.arg( mLibraryDirectory.path() ), 2 );
290 if ( mLibraryDirectory.count() == 0 )
292 QgsDebugError( u
"No dynamic QGIS data provider plugins found in:\n%1\n"_s.arg( mLibraryDirectory.path() ) );
296 const QString filePattern = getenv(
"QGIS_PROVIDER_FILE" );
297 QRegularExpression fileRegexp;
298 if ( !filePattern.isEmpty() )
300 fileRegexp.setPattern( filePattern );
303 typedef std::vector<QgsProviderMetadata *> *multiple_factory_function();
305 const auto constEntryInfoList = mLibraryDirectory.entryInfoList();
306 for (
const QFileInfo &fi : constEntryInfoList )
308 if ( !filePattern.isEmpty() )
310 if ( fi.fileName().indexOf( fileRegexp ) == -1 )
312 QgsDebugMsgLevel(
"provider " + fi.fileName() +
" skipped because doesn't match pattern " + filePattern, 2 );
318 if ( fi.fileName().contains( u
"authmethod"_s, Qt::CaseSensitivity::CaseInsensitive ) )
323 const QgsScopedRuntimeProfile profile( QObject::tr(
"Load %1" ).arg( fi.fileName() ) );
324 QLibrary myLib( fi.filePath() );
327 QgsDebugError( u
"Checking %1: ...invalid (lib not loadable): %2"_s.arg( myLib.fileName(), myLib.errorString() ) );
331 bool libraryLoaded {
false };
332 QFunctionPointer func = myLib.resolve( u
"providerMetadataFactory"_s.toLatin1().data() );
336 QgsProviderMetadata *meta =
function();
339 if ( findMetadata_( mProviders, meta->
key() ) )
341 QgsDebugError( u
"Checking %1: ...invalid (key %2 already registered)"_s.arg( myLib.fileName() ).arg( meta->
key() ) );
346 mProviders[meta->
key()] = meta;
347 libraryLoaded =
true;
352 QFunctionPointer multi_func = myLib.resolve( u
"multipleProviderMetadataFactory"_s.toLatin1().data() );
353 multiple_factory_function *multi_function =
reinterpret_cast< multiple_factory_function *
>(
cast_to_fptr( multi_func ) );
354 if ( multi_function )
356 std::vector<QgsProviderMetadata *> *metadatas = multi_function();
357 for (
const auto meta : *metadatas )
359 if ( findMetadata_( mProviders, meta->
key() ) )
361 QgsDebugError( u
"Checking %1: ...invalid (key %2 already registered)"_s.arg( myLib.fileName() ).arg( meta->
key() ) );
366 mProviders[meta->
key()] = meta;
367 libraryLoaded =
true;
373 if ( !libraryLoaded )
375 QgsDebugMsgLevel( u
"Checking %1: ...invalid (no providerMetadataFactory method)"_s.arg( myLib.fileName() ), 2 );
383 for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); ++it )
385 const QString &key = it->first;
387 const QgsScopedRuntimeProfile profile( QObject::tr(
"Initialize %1" ).arg( key ) );
389 QgsProviderMetadata *meta = it->second;
395 rebuildFilterStrings();
398 mDatabaseDrivers = QgsOgrProviderUtils::databaseDrivers();
401 mDirectoryDrivers = QgsOgrProviderUtils::directoryDrivers();
404 mProtocolDrivers = QgsOgrProviderUtils::protocolDrivers();
407void QgsProviderRegistry::rebuildFilterStrings()
409 mVectorFileFilters.clear();
410 mRasterFileFilters.clear();
411 mMeshFileFilters.clear();
412 mMeshDatasetFileFilters.clear();
413 mPointCloudFileFilters.clear();
414 mVectorTileFileFilters.clear();
415 mTiledSceneFileFilters.clear();
417 QStringList pointCloudWildcards;
418 QStringList pointCloudFilters;
420 QStringList vectorTileWildcards;
421 QStringList vectorTileFilters;
423 QStringList tiledSceneWildcards;
424 QStringList tiledSceneFilters;
426 for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); ++it )
428 QgsProviderMetadata *meta = it->second;
452 QgsDebugMsgLevel( u
"Checking %1: ...loaded OK (%2 file mesh filters)"_s.arg( it->first ).arg( mMeshFileFilters.split(
";;" ).count() ), 2 );
459 QgsDebugMsgLevel( u
"Checking %1: ...loaded OK (%2 file dataset filters)"_s.arg( it->first ).arg( mMeshDatasetFileFilters.split(
";;" ).count() ), 2 );
469 for (
const QString &filter : filters )
471 pointCloudFilters.append( filter );
483 for (
const QString &filter : filters )
485 vectorTileFilters.append( filter );
497 for (
const QString &filter : filters )
499 tiledSceneFilters.append( filter );
505 if ( !pointCloudFilters.empty() )
507 pointCloudFilters.insert( 0, QObject::tr(
"All Supported Files" ) + u
" (%1)"_s.arg( pointCloudWildcards.join(
' ' ) ) );
508 pointCloudFilters.insert( 1, QObject::tr(
"All Files" ) + u
" (*.*)"_s );
509 mPointCloudFileFilters = pointCloudFilters.join(
";;"_L1 );
512 if ( !vectorTileFilters.empty() )
514 vectorTileFilters.insert( 0, QObject::tr(
"All Supported Files" ) + u
" (%1)"_s.arg( vectorTileWildcards.join(
' ' ) ) );
515 vectorTileFilters.insert( 1, QObject::tr(
"All Files" ) + u
" (*.*)"_s );
516 mVectorTileFileFilters = vectorTileFilters.join(
";;"_L1 );
519 if ( !tiledSceneFilters.empty() )
521 tiledSceneFilters.insert( 0, QObject::tr(
"All Supported Files" ) + u
" (%1)"_s.arg( tiledSceneWildcards.join(
' ' ) ) );
522 tiledSceneFilters.insert( 1, QObject::tr(
"All Files" ) + u
" (*.*)"_s );
523 mTiledSceneFileFilters = tiledSceneFilters.join(
";;"_L1 );
530void QgsProviderRegistry::clean()
533 if ( QgsProject::sProject )
536 Providers::const_iterator it = mProviders.begin();
538 while ( it != mProviders.end() )
541 it->second->cleanupProvider();
548bool QgsProviderRegistry::exists()
550 return static_cast< bool >( sInstance );
555 qDeleteAll( mUnusableUriHandlers );
558 if ( sInstance ==
this )
578 Providers::const_iterator it = mProviders.begin();
580 if ( mProviders.empty() )
581 return QObject::tr(
"No data provider plugins are available. No vector layers can be loaded" );
588 while ( it != mProviders.end() )
593 list += it->second->description();
596 list +=
"<br></li>"_L1;
611 mLibraryDirectory = path;
618 return mLibraryDirectory;
646 const QList< QgsDataItemProvider * > itemProviders =
dataItemProviders( providerKey );
651 ret |= itemProvider->capabilities();
662 return QVariantMap();
693 const QString &providerKey,
699 QMap<int, int> &oldToNewAttrIdxMap,
700 QString &errorMessage,
701 const QMap<QString, QVariant> *options,
702 QString &createdLayerName
707 return meta->
createEmptyLayer( uri, fields, wkbType, srs, overwrite, oldToNewAttrIdxMap, errorMessage, options, createdLayerName );
710 errorMessage = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
716 const QString &providerKey,
718 const QString &format,
723 double *geoTransform,
725 const QStringList &creationOptions
730 return meta->
createRasterDataProvider( uri, format, nBands, type, width, height, geoTransform, crs, creationOptions );
741 return QList<QPair<QString, QString> >();
750 return QList<QgsDataItemProvider *>();
753int QgsProviderRegistry::listStyles(
const QString &providerKey,
const QString &uri, QStringList &ids, QStringList &names, QStringList &descriptions, QString &errCause )
759 res = meta->
listStyles( uri, ids, names, descriptions, errCause );
763 errCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
774 return meta->
styleExists( uri, styleId, errorCause );
778 errorCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
793 errCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
800 const bool ret(
false );
807 errCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
813 const QString &providerKey,
815 const QString &qmlStyle,
816 const QString &sldStyle,
817 const QString &styleName,
818 const QString &styleDescription,
819 const QString &uiFileContent,
827 ret = meta->
saveStyle( uri, qmlStyle, sldStyle, styleName, styleDescription, uiFileContent, useAsDefault, errCause );
830 errCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
843 errCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
856 errCause = QObject::tr(
"Unable to load %1 provider" ).arg( providerKey );
863 errorMessage.clear();
876 return meta->
createDb( dbPath, errCause );
879 errCause = u
"Resolving createDb(...) failed"_s;
895 Q_UNUSED( providerKey );
898 Q_UNUSED( widgetMode );
899 QgsDebugError(
"deprecated call - use QgsGui::sourceSelectProviderRegistry()->createDataSourceWidget() instead" );
906 const QString lib =
library( providerKey );
911 QLibrary myLib( lib );
917 return myLib.resolve( functionName.toLatin1().data() );
921 QgsDebugError(
"Cannot load library: " + myLib.errorString() );
929 const QString lib =
library( providerKey );
934 auto myLib = std::make_unique<QLibrary>( lib );
939 return myLib.release();
941 QgsDebugError(
"Cannot load library: " + myLib->errorString() );
948 QgsDebugError(
"deprecated - use QgsGui::providerGuiRegistry() instead." );
959 rebuildFilterStrings();
976 return mVectorFileFilters;
981 return mRasterFileFilters;
986 return mMeshFileFilters;
991 return mMeshDatasetFileFilters;
996 return mPointCloudFileFilters;
1001 return mVectorTileFileFilters;
1006 return mTiledSceneFileFilters;
1011 return mDatabaseDrivers;
1016 return mDirectoryDrivers;
1021 return mProtocolDrivers;
1027 for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); ++it )
1029 lst.append( it->first );
1036 return findMetadata_( mProviders, providerKey );
1042 for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); ++it )
1044 if ( it->second->supportedLayerTypes().contains( type ) )
1045 lst.insert( it->first );
1052 QList< QgsProviderRegistry::ProviderCandidateDetails > res;
1053 int maxPriority = 0;
1054 for (
auto it = mProviders.begin(); it != mProviders.end(); ++it )
1059 const int thisProviderPriority = it->second->priorityForUri( uri );
1060 if ( thisProviderPriority == 0 )
1063 if ( thisProviderPriority > maxPriority )
1066 maxPriority = thisProviderPriority;
1068 if ( thisProviderPriority == maxPriority )
1078 mUnusableUriHandlers << handler;
1086 if ( handler->matchesUri( uri ) )
1088 details = handler->details( uri );
1098 if ( providers.empty() )
1103 if ( provider.metadata()->key() == providerKey )
1111 for (
auto it = mProviders.begin(); it != mProviders.end(); ++it )
1113 if ( it->second->uriIsBlocklisted( uri ) )
1125 QList<QgsProviderSublayerDetails> res;
1126 for (
auto it = mProviders.begin(); it != mProviders.end(); ++it )
1132 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.
Represents a coordinate reference system (CRS).
Interface for providers that 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, const char *file=__builtin_FILE(), const char *function=__builtin_FUNCTION(), int line=__builtin_LINE(), Qgis::StringFormat format=Qgis::StringFormat::PlainText)
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.
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, QString &createdLayerName)
Creates new empty vector layer.
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.
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.
A container for the context for various read/write operations on objects.
Allows creation of a multi-layer database-side transaction.
#define Q_NOWARN_DEPRECATED_POP
#define Q_NOWARN_DEPRECATED_PUSH
#define QgsDebugMsgLevel(str, level)
#define QgsDebugError(str)
void cleanupProviderFunction_t()
Setting options for creating vector data providers.