Labeling layers with Python in QGIS. LinePlacementFlags

المشرف العام

Administrator
طاقم الإدارة
How could I set LinePlacementFlags with Python in QGIS?My code is something like:

palyr = QgsPalLayerSettings()palyr.readFromLayer(layer)palyr.enabled = Truepalyr.fieldName = "attribute"Then I've tried:

palyr.placement= QgsPalLayerSettings.LineAnd my labels are on the line. I want them above the line, but I can't figure how to do this.I found there is LinePlacementFlags type. But

palyr.LinePlacementFlags= QgsPalLayerSettings.AboveLinedidn't work.



أكثر...
 
أعلى