Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1644 closed bug (fixed)

QgsVectorLayer/Python: Vector layer has no display name

Reported by: cmoe Owned by: nobody
Priority: major: does not work as expected Milestone:
Component: Data Provider Version: Trunk
Keywords: python; QgsVectorLayer Cc:
Must Fix for Release: Yes Platform: RedHat
Platform Version: Awaiting user input: no

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 (2)

comment:1 by jef, 15 years ago

Resolution: fixed
Status: newclosed

fixed in r10605

comment:2 by (none), 15 years ago

Milestone: Version 1.1.0

Milestone Version 1.1.0 deleted

Note: See TracTickets for help on using tickets.