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 )
WidgetMode
Different ways a source select dialog can be used.
QList< QgsSourceSelectProvider * > providers()
Gets list of available providers.
QgsSourceSelectProviderRegistry()
void initializeFromProviderGuiRegistry(QgsProviderGuiRegistry *providerGuiRegistry)
Initializes the registry.
QgsAbstractDataSourceWidget * createSelectionWidget(const QString &name, QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode)
Gets select widget from provider with name.
~QgsSourceSelectProviderRegistry()
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 QList< QgsSourceSelectProvider * > sourceSelectProviders(const QString &providerKey)
Returns all source select providers registered in provider with providerKey.
QgsSourceSelectProvider * providerByName(const QString &name)
Returns a provider by name or nullptr if not found.
This is the interface for those who want to add entries to the QgsDataSourceManagerDialog.
bool removeProvider(QgsSourceSelectProvider *provider)
Remove provider implementation from the list (provider object is deleted)
void addProvider(QgsSourceSelectProvider *provider)
Add a provider implementation. Takes ownership of the object.
QStringList providerList() const
Returns list of available providers by their keys.
QList< QgsSourceSelectProvider * > providersByKey(const QString &providerKey)
Returns a (possibly empty) list of providers by data providerkey.
virtual int ordering() const
Ordering: the source select provider registry will be able to sort the source selects (ascending) usi...
A registry / canonical manager of GUI parts of data providers.