69 QgsPluginLayerRegistry::QgsPluginLayerRegistry()
75 if ( !mPluginLayerTypes.isEmpty() )
77 QgsDebugMsg(
"QgsPluginLayerRegistry::~QgsPluginLayerRegistry(): creator list not empty" );
79 for ( ; it != mPluginLayerTypes.constEnd(); ++it )
81 removePluginLayerType( it.
key() );
88 return mPluginLayerTypes.keys();
96 if ( mPluginLayerTypes.contains( type->
name() ) )
99 mPluginLayerTypes[type->
name()] = type;
106 if ( !mPluginLayerTypes.contains( typeName ) )
124 delete mPluginLayerTypes.take( typeName );
130 return mPluginLayerTypes.value( typeName,
nullptr );
139 QgsDebugMsg(
"Unknown plugin layer type: " + typeName );
Base class for all map layer types.
a registry of plugin layers types
QList< T > values() const
Base class for plugin layers.
bool removePluginLayerType(const QString &typeName)
Remove plugin layer type and return true on success.
QgsPluginLayerType(const QString &name)
QMap< QString, QgsMapLayer * > mapLayers() const
Returns a map of all registered layers by layer ID.
void removeMapLayers(const QStringList &theLayerIds)
Remove a set of layers from the registry by layer ID.
QgsMapLayer::LayerType type() const
Get the type of the layer.
virtual QgsPluginLayer * createLayer()
Return new layer of this type.
QgsPluginLayerType * pluginLayerType(const QString &typeName)
Return plugin layer type metadata or NULL if doesn't exist.
bool addPluginLayerType(QgsPluginLayerType *pluginLayerType)
Add plugin layer type (take ownership) and return true on success.
QString id() const
Get this layer's unique ID, this ID is used to access this layer from map layer registry.
~QgsPluginLayerRegistry()
virtual ~QgsPluginLayerType()
QString pluginLayerType()
Return plugin layer type (the same as used in QgsPluginLayerRegistry)
virtual bool showLayerProperties(QgsPluginLayer *layer)
Show plugin layer properties dialog.
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
QStringList pluginLayerTypes()
List all known layer types.
static QgsPluginLayerRegistry * instance()
Means of accessing canonical single instance.
QgsPluginLayer * createLayer(const QString &typeName, const QString &uri=QString())
Return new layer if corresponding plugin has been found, else return NULL.
class for creating plugin specific layers