28 qDeleteAll( mProviders );
38 mProviders.append( provider );
43 int index = mProviders.indexOf( provider );
46 delete mProviders.takeAt( index );
55 if ( !providerGuiRegistry )
58 const QStringList providersList = providerGuiRegistry->
providerList();
59 for (
const QString &key : providersList )
63 for (
auto provider : providerList )
72 const QList<QgsSubsetStringEditorProvider *> providerList =
providers();
73 for (
const auto provider : providerList )
75 if ( provider->name() == name )
85 QList<QgsSubsetStringEditorProvider *> result;
86 const QList<QgsSubsetStringEditorProvider *> providerList =
providers();
87 for (
const auto provider : providerList )
89 if ( provider->providerKey() == providerKey )
99 const QList<QgsSubsetStringEditorProvider *> providerList =
providers();
103 for (
const auto provider : providerList )
105 if ( provider->canHandleLayer( layer ) )
107 if ( provider->canHandleLayerStorageType( layer ) )
111 bestProviderCandidate = provider;
114 if ( bestProviderCandidate )
116 return bestProviderCandidate->
createDialog( layer, parent, fl );
A registry / canonical manager of GUI parts of data providers.
virtual QList< QgsSubsetStringEditorProvider * > subsetStringEditorProviders(const QString &providerKey)
Returns all subset string editor providers registered in provider with providerKey.
QStringList providerList() const
Returns list of available providers by their keys.
Query Builder for layers.
Interface for a dialog that can edit subset strings.
QgsSubsetStringEditorInterface * createDialog(QgsVectorLayer *layer, QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
Creates a new dialog to edit the subset string of the provided layer.
bool removeProvider(QgsSubsetStringEditorProvider *provider)
Remove provider implementation from the list (provider object is deleted)
QgsSubsetStringEditorProvider * providerByName(const QString &name)
Returns a provider by name or nullptr if not found.
void initializeFromProviderGuiRegistry(QgsProviderGuiRegistry *providerGuiRegistry)
Initializes the registry.
QList< QgsSubsetStringEditorProvider * > providersByKey(const QString &providerKey)
Returns a (possibly empty) list of providers by data providerkey.
QgsSubsetStringEditorProviderRegistry()
void addProvider(QgsSubsetStringEditorProvider *provider)
Add a provider implementation. Takes ownership of the object.
~QgsSubsetStringEditorProviderRegistry()
QList< QgsSubsetStringEditorProvider * > providers()
Gets list of available providers.
This is the interface for those who want to provide a dialog to edit a subset string.
virtual QgsSubsetStringEditorInterface * createDialog(QgsVectorLayer *layer, QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)=0
Creates a new dialog to edit the subset string of the provided layer.
Represents a vector layer which manages a vector based data sets.