26 qDeleteAll( mProviders );
36 mProviders.append( provider );
39 return first->ordering() < second->ordering();
45 int index = mProviders.indexOf( provider );
48 delete mProviders.takeAt( index );
57 if ( !providerGuiRegistry )
60 const QStringList providersList = providerGuiRegistry->
providerList();
61 for (
const QString &key : providersList )
63 const QList<QgsSourceSelectProvider *> providerList = providerGuiRegistry->
sourceSelectProviders( key );
65 for (
auto provider : providerList )
74 const QList<QgsSourceSelectProvider *> providerList =
providers();
75 for (
const auto provider : providerList )
77 if ( provider->name() == name )
87 QList<QgsSourceSelectProvider *> result;
88 const QList<QgsSourceSelectProvider *> providerList =
providers();
89 for (
const auto provider : providerList )
91 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()
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).