Bug report #1644

QgsVectorLayer/Python: Vector layer has no display name

Added by cmoe - over 15 years ago. Updated over 15 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Data Provider
Affected QGIS version: Regression?:No
Operating System:RedHat Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:11704

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

Associated revisions

Revision 4ac3e654
Added by Jürgen Fischer over 15 years ago

fix #1644

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10605 c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision d72d5abc
Added by Jürgen Fischer over 15 years ago

fix #1644

git-svn-id: http://svn.osgeo.org/qgis/trunk@10605 c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#1 Updated by Jürgen Fischer over 15 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

fixed in

#2 Updated by Anonymous over 15 years ago

Milestone Version 1.1.0 deleted

Also available in: Atom PDF