SVGExport: Initialize option.exposedRect for items that use it

This commit is contained in:
Ales Erjavec 2018-07-06 15:53:28 +02:00
parent 3d3d0a2459
commit 56950479f9

View File

@ -180,7 +180,10 @@ def _generateItemSvg(item, nodes=None, root=None, options={}):
item.setExportMode(True, {'painter': p})
try:
p.setTransform(tr)
item.paint(p, QtGui.QStyleOptionGraphicsItem(), None)
opt = QtGui.QStyleOptionGraphicsItem()
if item.flags() & QtGui.QGraphicsItem.ItemUsesExtendedStyleOption:
opt.exposedRect = item.boundingRect()
item.paint(p, opt, None)
finally:
p.end()
## Can't do this here--we need to wait until all children have painted as well.