[Qgis-developer] How to use setStyle in QgsComposerScaleBar Class

Michael Pfeiffer Michael.Pfeiffer at bd.so.ch
Tue Jan 11 06:02:35 EST 2011


Hi everybody,

I'm working on a Python PlugIn which creates a map composition.
In the map composition I want to implement a scalebar item in numeric style.
I try to implement the scalebar item with the following code

 
item = QgsComposerScaleBar(composition)
item.setStyle('Numeric')
item.setItemPosition(margin_left+offset_x,  margin_top+offset_y)
composerView.addComposerScaleBar(item)


With this code I get a scalebar item in the print composer but it's in
single Box style.
It doesn't matter what kind of style I select in setStyle.
It's everytime single Box style.
No error messages.


print item.style() 


prints the correct style.
Am I doing something wrong or is this a bug?

Thx in advance for your answers
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/How-to-use-setStyle-in-QgsComposerScaleBar-Class-tp5910397p5910397.html
Sent from the qgis-developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list