18#include "moc_qgssourceselectproviderregistry.cpp"
27 qDeleteAll( mProviders );
37 mProviders.append( provider );
40 return first->ordering() < second->ordering();
48 const QString name = provider ? provider->
name() : QString();
49 const int index = mProviders.indexOf( provider );
52 delete mProviders.takeAt( index );
62 if ( !providerGuiRegistry )
65 const QStringList providersList = providerGuiRegistry->
providerList();
66 for (
const QString &key : providersList )
68 const QList<QgsSourceSelectProvider *> providerList = providerGuiRegistry->
sourceSelectProviders( key );
70 for (
auto provider : providerList )
79 const QList<QgsSourceSelectProvider *> providerList =
providers();
80 for (
const auto provider : providerList )
82 if ( provider->name() == name )
92 QList<QgsSourceSelectProvider *> result;
93 const QList<QgsSourceSelectProvider *> providerList =
providers();
94 for (
const auto provider : providerList )
96 if ( provider->providerKey() == providerKey )
A registry / canonical manager of GUI parts of data providers.
virtual QList< QgsSourceSelectProvider * > sourceSelectProviders(const QString &providerKey)
Returns all source select providers registered in provider with providerKey.
QStringList providerList() const
Returns list of available providers by their keys.
WidgetMode
Different ways a source select dialog can be used.
QgsAbstractDataSourceWidget * createSelectionWidget(const QString &name, QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode)
Gets select widget from provider with name.
void initializeFromProviderGuiRegistry(QgsProviderGuiRegistry *providerGuiRegistry)
Initializes the registry.
~QgsSourceSelectProviderRegistry()
QList< QgsSourceSelectProvider * > providersByKey(const QString &providerKey)
Returns a (possibly empty) list of providers by data providerkey.
QgsSourceSelectProviderRegistry()
void providerRemoved(const QString &name)
Emitted whenever a provider is removed from the registry.
void providerAdded(const QString &name)
Emitted whenever a provider is added to the registry.
QList< QgsSourceSelectProvider * > providers()
Gets list of available providers.
QgsSourceSelectProvider * providerByName(const QString &name)
Returns a provider by name or nullptr if not found.
void addProvider(QgsSourceSelectProvider *provider)
Add a provider implementation. Takes ownership of the object.
bool removeProvider(QgsSourceSelectProvider *provider)
Remove provider implementation from the list (provider object is deleted)
This is the interface for those who want to add entries to the QgsDataSourceManagerDialog.
virtual QgsAbstractDataSourceWidget * createDataSourceWidget(QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode=QgsProviderRegistry::WidgetMode::Embedded) const =0
Create a new instance of QgsAbstractDataSourceWidget (or nullptr).
virtual QString name() const
Source select provider name, this is useful to retrieve a particular source select in case the provid...