Skip to content
Permalink
Browse files

API to register new vector data providers

  • Loading branch information
elpaso committed Apr 19, 2018
1 parent 222f3ad commit 9d66eb8db47ebcad755bf780b1d4d5d49bad10e1
@@ -180,6 +180,19 @@ Returns a string containing the available protocol drivers

void registerGuis( QWidget *widget );

void registerProvider( QgsProviderMetadata *providerMetadata /Transfer/ );
%Docstring
register a new vector data provider from its ``providerMetadata``

:param providerMetadata: QgsProviderMetadata instance describing the new provider

.. note::

ownership of the QgsProviderMetadata instance is transferred to the registry

.. versionadded:: 3.2
%End



private:
@@ -525,6 +525,12 @@ void QgsProviderRegistry::registerGuis( QWidget *parent )
}
}

void QgsProviderRegistry::registerProvider( QgsProviderMetadata *providerMetadata )
{
if ( providerMetadata )
mProviders[ providerMetadata->key() ] = providerMetadata;
}

QString QgsProviderRegistry::fileVectorFilters() const
{
return mVectorFileFilters;
@@ -179,6 +179,14 @@ class CORE_EXPORT QgsProviderRegistry

void registerGuis( QWidget *widget );

/**
* \brief register a new vector data provider from its \a providerMetadata
* \param providerMetadata QgsProviderMetadata instance describing the new provider
* \note ownership of the QgsProviderMetadata instance is transferred to the registry
* \since QGIS 3.2
*/
void registerProvider( QgsProviderMetadata *providerMetadata SIP_TRANSFER );

/**
* Open the given vector data source
*

0 comments on commit 9d66eb8

Please sign in to comment.
You can’t perform that action at this time.