Ejemplo n.º 1
0
QgsPluginLayer* QgsPluginLayerRegistry::createLayer( QString typeName )
{
  QgsPluginLayerType* type = pluginLayerType( typeName );
  if ( !type )
  {
    QgsDebugMsg( "Unknown plugin layer type: " + typeName );
    return NULL;
  }

  return type->createLayer();
}
Ejemplo n.º 2
0
QgsPluginLayer* QgsPluginLayerRegistry::createLayer( const QString& typeName, const QString& uri )
{
  QgsPluginLayerType* type = pluginLayerType( typeName );
  if ( !type )
  {
    QgsDebugMsg( "Unknown plugin layer type: " + typeName );
    return nullptr;
  }

  if ( !uri.isEmpty() )
    return type->createLayer( uri );
  else
    return type->createLayer();
}