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 ) )
93 const auto constLayers = layers;
102 QStringList() << layer->id() );
107 delete mPluginLayerTypes.take( typeName );
113 return mPluginLayerTypes.value( typeName,
nullptr );
122 QgsDebugMsg(
"Unknown plugin layer type: " + typeName );
126 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)
virtual QgsPluginLayer * createLayer()
Returns new layer of this type. Return nullptr on error.
QgsPluginLayerType * pluginLayerType(const QString &typeName)
Returns plugin layer type metadata or nullptr if doesn't exist.
bool addPluginLayerType(QgsPluginLayerType *pluginLayerType)
Add plugin layer type (take ownership) and return true on success.
~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 nullptr.
class for creating plugin specific layers