QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
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
***************************************************************************/
15
#include "
qgsdataitemguiproviderregistry.h
"
16
17
#include "
qgsdataitemguiprovider.h
"
18
#include "
qgsproviderguiregistry.h
"
19
#include "
qgsproviderregistry.h
"
20
21
QgsDataItemGuiProviderRegistry::QgsDataItemGuiProviderRegistry
() =
default
;
22
23
QgsDataItemGuiProviderRegistry::~QgsDataItemGuiProviderRegistry
()
24
{
25
qDeleteAll( mProviders );
26
}
27
28
void
QgsDataItemGuiProviderRegistry::addProvider
(
QgsDataItemGuiProvider
*provider )
29
{
30
mProviders.append( provider );
31
}
32
33
void
QgsDataItemGuiProviderRegistry::removeProvider
(
QgsDataItemGuiProvider
*provider )
34
{
35
const
int
index = mProviders.indexOf( provider );
36
if
( index >= 0 )
37
delete
mProviders.takeAt( index );
38
}
39
40
void
QgsDataItemGuiProviderRegistry::initializeFromProviderGuiRegistry
(
QgsProviderGuiRegistry
*providerGuiRegistry )
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
}
QgsDataItemGuiProviderRegistry::~QgsDataItemGuiProviderRegistry
~QgsDataItemGuiProviderRegistry()
Definition
qgsdataitemguiproviderregistry.cpp:23
QgsDataItemGuiProviderRegistry::QgsDataItemGuiProviderRegistry
QgsDataItemGuiProviderRegistry()
QgsDataItemGuiProviderRegistry::initializeFromProviderGuiRegistry
void initializeFromProviderGuiRegistry(QgsProviderGuiRegistry *providerGuiRegistry)
Initializes the registry.
Definition
qgsdataitemguiproviderregistry.cpp:40
QgsDataItemGuiProviderRegistry::removeProvider
void removeProvider(QgsDataItemGuiProvider *provider)
Removes a provider implementation from the registry.
Definition
qgsdataitemguiproviderregistry.cpp:33
QgsDataItemGuiProviderRegistry::addProvider
void addProvider(QgsDataItemGuiProvider *provider)
Adds a provider implementation to the registry.
Definition
qgsdataitemguiproviderregistry.cpp:28
QgsDataItemGuiProvider
Abstract base class for providers which affect how QgsDataItem items behave within the application GU...
Definition
qgsdataitemguiprovider.h:122
QgsProviderGuiRegistry
A registry / canonical manager of GUI parts of data providers.
Definition
qgsproviderguiregistry.h:54
QgsProviderGuiRegistry::dataItemGuiProviders
virtual const QList< QgsDataItemGuiProvider * > dataItemGuiProviders(const QString &providerKey)
Returns all data item gui providers registered in provider with providerKey.
Definition
qgsproviderguiregistry.cpp:244
QgsProviderGuiRegistry::providerList
QStringList providerList() const
Returns list of available providers by their keys.
Definition
qgsproviderguiregistry.cpp:299
qgsdataitemguiprovider.h
qgsdataitemguiproviderregistry.h
qgsproviderguiregistry.h
qgsproviderregistry.h
Generated on
for QGIS API Documentation by
1.17.0