Is there a way to achieve something similar to scripting in svg file, so it works when it’s opened in python gui? I need funcionality similar to one in this example, but I am opening my svg in python like this:
self.setScene(QtGui.QGraphicsScene(self))
self.scene().addItem(QtSvg.QGraphicsSvgItem(QtCore.QFile(pathToMySVG).fileName()))
where self is QtGui.QGraphicsView.
I have also tried without scripting, with these examples, but still there is no interactivity.
Any help-examples would be appreciated.
@Vicent Actually I’ve found solution using QGraphicsWebView():
It works perfect for me (scripting and other stuff).
Only thing that I don’t like is that I have to load my svg as QGraphicsSvgItem, because I didn’t know other way to get size of my svg. Apparently
webview.size()does not return expected values.