57 if ( !mPluginLayerTypes.isEmpty() )
59 QgsDebugMsg( QStringLiteral(
"QgsPluginLayerRegistry::~QgsPluginLayerRegistry(): creator list not empty" ) );
60 const QStringList keys = mPluginLayerTypes.keys();
61 for (
const QString &key : keys )
63 removePluginLayerType( key );
70 return mPluginLayerTypes.keys();
78 if ( mPluginLayerTypes.contains( type->
name() ) )
81 mPluginLayerTypes[type->
name()] = type;
88 if ( !mPluginLayerTypes.contains( typeName ) )
101 QStringList() << layer->
id() );
106 delete mPluginLayerTypes.take( typeName );
112 return mPluginLayerTypes.value( typeName,
nullptr );
121 QgsDebugMsg(
"Unknown plugin layer type: " + typeName );
125 if ( !uri.isEmpty() )
Base class for all map layer types.
QgsMapLayer::LayerType type() const
Returns the type of the layer.
Base class for plugin layers.
bool removePluginLayerType(const QString &typeName)
Remove plugin layer type and return true on success.
QgsPluginLayerType(const QString &name)
virtual QgsPluginLayer * createLayer()
Returns new layer of this type. Return NULL on error.
QgsPluginLayerType * pluginLayerType(const QString &typeName)
Returns 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.
~QgsPluginLayerRegistry()
QString id() const
Returns the layer's unique ID, which is used to access this layer from QgsProject.
QString pluginLayerType()
Returns plugin layer type (the same as used in QgsPluginLayerRegistry)
virtual bool showLayerProperties(QgsPluginLayer *layer)
Show plugin layer properties dialog. Return false if the dialog cannot be shown.
QStringList pluginLayerTypes()
List all known layer types.
static QgsProject * instance()
Returns the QgsProject singleton instance.
void removeMapLayers(const QStringList &layerIds)
Remove a set of layers from the registry by layer ID.
QMap< QString, QgsMapLayer * > mapLayers() const
Returns a map of all registered layers by layer ID.
QgsPluginLayer * createLayer(const QString &typeName, const QString &uri=QString())
Returns new layer if corresponding plugin has been found else returns a nullptr.
class for creating plugin specific layers