Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. item = QgsComposerScaleBar(c)
  2. item.setStyle("Line Ticks Up") # optionally modify the style
  3. item.setComposerMap(composerMap)
  4. c.addItem(item)
  5.  
  6. brush = ScaleBar.brush()
  7. brush.setColor(QColor(255, 0, 0, 0))
  8. QgsComposerScaleBar.setBrush(brush)
  9.  
  10. scalebaritem = super(QgsComposerItem, ScaleBar)
  11. scalebaritem.setBrush(QColor(0,0,0,0))
  12.  
  13. ScaleBar.font().toString()
  14. PyQt4.QtCore.QString(u'Ubuntu,12,-1,5,50,0,0,0,0,0')
  15. >>> ScaleBar.font().setPointSize(8)
  16. >>> ScaleBar.font().pointSize()
  17. 12
  18.  
  19. f = ScaleBar.font()
  20. f.setPointSize(8)
  21. ScaleBar.setFont(f)
  22.  
  23. ScaleBar = QgsComposerScaleBar(c)
  24. ScaleBar.setComposerMap(composerMap)
  25. ScaleBar.setStyle('Line Ticks Middle') # optionally modify the style
  26. ScaleBar.setFrame(False)
  27. ScaleBar.setUnitLabeling(QString("km"))
  28. ScaleBar.setNumMapUnitsPerScaleBarUnit(1000)
  29.  
  30. brush = ScaleBar.brush()
  31. brush.setColor(QColor(255, 0, 0, 0))
  32. QgsComposerScaleBar.setBrush(brush)
  33.  
  34. ScaleBar.setItemPosition(50,40)
  35. ScaleBar.applyDefaultSize()
  36. #ScaleBar.update()
  37. c.addItem(ScaleBar)
  38.  
  39. ScaleBar.font().toString()
  40. PyQt4.QtCore.QString(u'Ubuntu,12,-1,5,50,0,0,0,0,0')
  41. >>> ScaleBar.font().setPointSize(8)
  42. >>> ScaleBar.font().pointSize()
  43. 12
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement