Ticket #1644 (closed bug: fixed)
QgsVectorLayer/Python: Vector layer has no display name
Description
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
Cédric
Change History
Note: See
TracTickets for help on using
tickets.