Bug report #4848

Missing python binding for QgsSimpleMarkerSymbolLayerV2

Added by Tim Sutton almost 12 years ago. Updated over 10 years ago.

Assignee:Martin Dobias
Category:Python plugins
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed
Crashes QGIS or corrupts data:No Copied to github as #:14683



I need to change the outline colour of symbollayers via python. I thought I would be able to do so using the following example:

mySymbolLayer = QgsSimpleMarkerSymbolLayerV2()
mySymbol.changeSymbolLayer(0, mySymbolLayer)

However it seems htat QgsSimpleMarkerSymbolLayerV2 is not exposed via the python API. Am I missing something or can you add it to the api?




#1 Updated by Martin Dobias almost 12 years ago

Hi Tim

in meanwhile you can construct the symbol layers indirectly by specifying the symbol layer type and a set of properties:

>>> meta=QgsSymbolLayerV2Registry.instance().symbolLayerMetadata("SimpleMarker")
>>> sl=meta.createSymbolLayer( { "name" : "star", "size" : "5", "color" : "255,0,0", "color_border" : "0,0,0" } )

#2 Updated by Tim Sutton almost 12 years ago

Hi Martin

OK brilliant thanks, I will test that. I will leave the ticket open in the meantime until bindings are available.



#3 Updated by Paolo Cavallini over 11 years ago

  • Target version changed from Version 1.7.4 to Version 1.8.0

#4 Updated by Paolo Cavallini about 11 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#5 Updated by Alexander Bruy over 10 years ago

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

Also available in: Atom PDF