[QGIS-trac] [Quantum GIS] #1644: QgsVectorLayer/Python: Vector layer has no display name

Quantum GIS qgis at qgis.org
Mon Apr 20 13:11:15 EDT 2009


#1644: QgsVectorLayer/Python: Vector layer has no display name
------------------------------------------------+---------------------------
   Reporter:  cmoe                              |              Owner:  nobody       
       Type:  bug                               |             Status:  new          
   Priority:  major: does not work as expected  |          Milestone:  Version 1.1.0
  Component:  Data Provider                     |            Version:  HEAD         
   Keywords:  python; QgsVectorLayer            |   Platform_version:               
   Platform:  RedHat                            |           Must_fix:  Yes          
Status_info:  0                                 |  
------------------------------------------------+---------------------------
 If i'm loading a postgis layer with python, like

 {{{
 uri = QgsDataSourceURI()
 uri.setConnection('host','port','mydb','public','')
 uri.setDataSource('public','foo','wkb_geometry','')
 layer = QgsVectorLayer(uri.uri(),'bar','postgres')
 QgsMapLayerRegistry.instance().addMapLayer(layer);
 }}}

 the new layer has no display name in the legend and its properties (print
 layer.name() has also no output). If i'm setting the name by using
 layer.setLayerName('bar'), the name is there, but it would be cool, if the
 constructor sets the name itsself like before.

 It works for raster data and it works also if i'm using the postgis
 connector tool.

 regards[[BR]]

 Cédric

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1644>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list