Skip to content
Permalink
Browse files

[processing] draw vector icons when available in modeler

  • Loading branch information
nirvn committed Apr 30, 2018
1 parent 1370a5c commit 08db66fb032df28b5d0058f43fa6ce6b80ba6404
Showing with 10 additions and 1 deletion.
  1. +10 −1 python/plugins/processing/modeler/ModelerGraphicItem.py
@@ -75,8 +75,17 @@ def __init__(self, element, model, controls, scene=None):
self.pixmap = None
self.text = element.name()
else:
if element.algorithm().svgIconPath():
svg = QSvgRenderer(element.algorithm().svgIconPath())
size = svg.defaultSize()
self.picture = QPicture()
painter = QPainter(self.picture)
painter.scale(16 / size.width(), 16 / size.width())
svg.render(painter)
self.pixmap = None
else:
self.pixmap = element.algorithm().icon().pixmap(15, 15)
self.text = element.description()
self.pixmap = element.algorithm().icon().pixmap(15, 15)
self.arrows = []
self.setFlag(QGraphicsItem.ItemIsMovable, True)
self.setFlag(QGraphicsItem.ItemIsSelectable, True)

0 comments on commit 08db66f

Please sign in to comment.
You can’t perform that action at this time.