QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsdataitemguiproviderregistry.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsdataitemguiproviderregistry.cpp
3 --------------------------------------
4 Date : October 2018
5 Copyright : (C) 2018 by Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
16
19#include "qgsproviderregistry.h"
20
22
27
29{
30 mProviders.append( provider );
31}
32
34{
35 const int index = mProviders.indexOf( provider );
36 if ( index >= 0 )
37 delete mProviders.takeAt( index );
38}
39
41{
42 if ( !providerGuiRegistry )
43 return;
44
45 const QStringList providersList = providerGuiRegistry->providerList();
46
47 for ( const QString &key : providersList )
48 {
49 const QList<QgsDataItemGuiProvider *> providerList = providerGuiRegistry->dataItemGuiProviders( key );
50 // the function is a factory - we keep ownership of the returned providers
51 mProviders << providerList;
52 }
53}
void initializeFromProviderGuiRegistry(QgsProviderGuiRegistry *providerGuiRegistry)
Initializes the registry.
void removeProvider(QgsDataItemGuiProvider *provider)
Removes a provider implementation from the registry.
void addProvider(QgsDataItemGuiProvider *provider)
Adds a provider implementation to the registry.
Abstract base class for providers which affect how QgsDataItem items behave within the application GU...
A registry / canonical manager of GUI parts of data providers.
virtual const QList< QgsDataItemGuiProvider * > dataItemGuiProviders(const QString &providerKey)
Returns all data item gui providers registered in provider with providerKey.
QStringList providerList() const
Returns list of available providers by their keys.