Bug report #4848
Missing python binding for QgsSimpleMarkerSymbolLayerV2
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 almost 13 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 13 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 12 years ago
- Target version changed from Version 1.7.4 to Version 1.8.0
#4 Updated by Paolo Cavallini about 12 years ago
- Target version changed from Version 1.8.0 to Version 2.0.0
#5 Updated by Alexander Bruy over 11 years ago
- Resolution set to fixed
- Status changed from Open to Closed
Seems bindings already added, see https://github.com/qgis/Quantum-GIS/blob/master/python/core/symbology-ng/qgsmarkersymbollayerv2.sip