When adding attributes using the following methods and arguments, everything works correctly BUT not comment is shown in the source section of the layer's properties.

Why is this?

How can add the comment using Python in QGIS?

layer.dataProvider().addAttributes([QgsField("somename", QVariant.String,"String",20,0,"Why does this comment not show up?!")])

comments section for source in properties

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.