Hi,<br><br>in my plugin I create a layer using the following code:<br><br>self.lines
 = QgsVectorLayer("LineString", "temporary_lines", "memory")<br> 
self.lines.startEditing()<br>field = QgsField("label", QVariant.String)<br>
field.setLength(100)<br> ret = self.lines.addAttribute(field)<br> 
QgsMapLayerRegistry.instance().addMapLayer(self.lines)<br><div id=":im" class="ii gt">self.lines.commitChanges()<br><br>However,
 the field is not added to the layer and "ret" is false. I realized I am
 not even able to add the attribute in the GUI using layer Properties 
dialog - the Type dropdown in Attributes - Add column window is empty. 
Is it bug or a feature that I cannot add attributes to memory layer?<br>
<br>I'm using 1.4.0 on Windows XP.<br><br>Thanks for help.<br><br>Vaclav</div>