I believe this is simple question, but not for beginners as I am. My code is:
...
svg_file = QtCore.QFile('C:\svgTest.svg')
self.svgItem = QtSvg.QGraphicsSvgItem(svg_file.fileName())
...
How do I get width and height of self.svgItem?
I’ve tried this:
print self.svgItem.boundingRect()
and get:
PyQt4.QtCore.QRectF(0.0, 0.0, 300.0, 383.0)
where “300” and “383” are values that I need.
QRectFobjects haveheight()andwidth()methods.So you can do:
See the Qt documentation on QRectF for details.