Bug report #4848

Missing python binding for QgsSimpleMarkerSymbolLayerV2

Added by Tim Sutton over 7 years ago. Updated about 6 years ago.

Status:Closed
Priority:Normal
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

Description

Hi

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()
mySymbolLayer.setColor(myColour)
mySymbolLayer.setBorderColor(myColour)
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?

Thanks

Tim

History

#1 Updated by Martin Dobias over 7 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 over 7 years ago

Hi Martin

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

Regards

Tim

#3 Updated by Paolo Cavallini over 7 years ago

  • Target version changed from Version 1.7.4 to Version 1.8.0

#4 Updated by Paolo Cavallini about 7 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#5 Updated by Alexander Bruy about 6 years ago

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

Also available in: Atom PDF