self.sc=QtGui.QGraphicsScene(self.myGraphicsView)
In function for show SVG, we write:
r=QtSvg.QSvgRenderer()
r.load(QtCore.QByteArray(mySVG))
r.setViewBox(QtCore.QRectF(0.0, 0.0, 3500.0, 3500.0))
item=QtSvg.QGraphicsSvgItem()
item.setSharedRenderer(r)
item.setScale(20.0)
self.sc.clear()
self.sc.setSceneRect(QtCore.QRectF(0.0, 0.0, 2000.0, 1000.0))
item.setPos(QtCore.QPointF(10,50))
self.sc.addItem(item)
self.graphicsView.setScene(self.sc)
self.graphicsView.centerOn(0,0)
mySVG - source of the SVG-file (as text)
Picture size is 3500 by 3500 pixels.
Комментариев нет:
Отправить комментарий