57 if ( !mPluginLayerTypes.isEmpty() )
59 QgsDebugMsg( QStringLiteral(
"QgsPluginLayerRegistry::~QgsPluginLayerRegistry(): creator list not empty" ) );
60 PluginLayerTypes::const_iterator it = mPluginLayerTypes.constBegin();
61 for ( ; it != mPluginLayerTypes.constEnd(); ++it )
63 removePluginLayerType( it.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.
Base class for plugin layers.
bool removePluginLayerType(const QString &typeName)
Remove plugin layer type and return true on success.
QgsPluginLayerType(const QString &name)
QgsMapLayer::LayerType type() const
Returns the type of the layer.
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.
QString id() const
Returns the layer's unique ID, which is used to access this layer from QgsProject.
~QgsPluginLayerRegistry()
QString pluginLayerType()
Returns plugin layer type (the same as used in QgsPluginLayerRegistry)
QMap< QString, QgsMapLayer * > mapLayers(const bool validOnly=false) const
Returns a map of all registered layers by layer ID.
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.
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