[Exporter] Fix for QtGui.QGraphicsScene
This commit is contained in:
parent
482ca528f6
commit
5bdd25ea40
@ -1,7 +1,6 @@
|
|||||||
from ..widgets.FileDialog import FileDialog
|
from ..widgets.FileDialog import FileDialog
|
||||||
from ..Qt import QtGui, QtCore, QtSvg
|
from ..Qt import QtGui, QtCore, QtSvg
|
||||||
from ..python2_3 import asUnicode, basestring
|
from ..python2_3 import asUnicode, basestring
|
||||||
from ..GraphicsScene import GraphicsScene
|
|
||||||
import os, re
|
import os, re
|
||||||
LastExportDirectory = None
|
LastExportDirectory = None
|
||||||
|
|
||||||
@ -77,21 +76,21 @@ class Exporter(object):
|
|||||||
self.export(fileName=fileName, **self.fileDialog.opts)
|
self.export(fileName=fileName, **self.fileDialog.opts)
|
||||||
|
|
||||||
def getScene(self):
|
def getScene(self):
|
||||||
if isinstance(self.item, GraphicsScene):
|
if isinstance(self.item, QtGui.QGraphicsScene):
|
||||||
return self.item
|
return self.item
|
||||||
else:
|
else:
|
||||||
return self.item.scene()
|
return self.item.scene()
|
||||||
|
|
||||||
def getSourceRect(self):
|
def getSourceRect(self):
|
||||||
if isinstance(self.item, GraphicsScene):
|
if isinstance(self.item, QtGui.QGraphicsScene):
|
||||||
w = self.item.getViewWidget()
|
w = self.item.views()[0]
|
||||||
return w.viewportTransform().inverted()[0].mapRect(w.rect())
|
return w.viewportTransform().inverted()[0].mapRect(w.rect())
|
||||||
else:
|
else:
|
||||||
return self.item.sceneBoundingRect()
|
return self.item.sceneBoundingRect()
|
||||||
|
|
||||||
def getTargetRect(self):
|
def getTargetRect(self):
|
||||||
if isinstance(self.item, GraphicsScene):
|
if isinstance(self.item, QtGui.QGraphicsScene):
|
||||||
return self.item.getViewWidget().rect()
|
return self.item.views()[0].rect()
|
||||||
else:
|
else:
|
||||||
return self.item.mapRectToDevice(self.item.boundingRect())
|
return self.item.mapRectToDevice(self.item.boundingRect())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user