18#include "moc_qgssourceselectproviderregistry.cpp"
27 qDeleteAll( mProviders );
37 mProviders.append( provider );
39 return first->ordering() < second->ordering();
47 const QString name = provider ? provider->
name() : QString();
48 const int index = mProviders.indexOf( provider );
51 delete mProviders.takeAt( index );
61 if ( !providerGuiRegistry )
64 const QStringList providersList = providerGuiRegistry->
providerList();
65 for (
const QString &key : providersList )
67 const QList<QgsSourceSelectProvider *> providerList = providerGuiRegistry->
sourceSelectProviders( key );
69 for (
auto provider : providerList )
78 const QList<QgsSourceSelectProvider *> providerList =
providers();
79 for (
const auto provider : providerList )
81 if ( provider->name() == name )
91 QList<QgsSourceSelectProvider *> result;
92 const QList<QgsSourceSelectProvider *> providerList =
providers();
93 for (
const auto provider : providerList )
95 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...