[PyQt] QtSvg.QSvgRenderer.boundsOnElement issue

Aron Bierbaum aronbierbaum at gmail.com
Mon Apr 27 17:38:40 BST 2009


I have recently downloaded and testing with the latest PyQt 4.5
snapshot, 20090426, and I am having a few problems. If I run the
attached test program with PyQt 4.4.4 and Qt 4.5.0 I get the correct
output:

Square 1 bounds: PyQt4.QtCore.QRectF(10.000000720000001,
942.36217671999998, 100.00000056, 100.00000055999999)
Square 2 bounds: PyQt4.QtCore.QRectF(119.99999839, 832.36216838999997,
99.999998219999981, 99.999998220000066)
Square 3 bounds: PyQt4.QtCore.QRectF(230.00000691, 942.36218690999999,
100.00000317999999, 100.00000318000002)

But if I run with Qt 4.5.0 and the latest PyQt 4.5 snapshot I get
empty QRects for all bounds:

Square 1 bounds: PyQt4.QtCore.QRectF(0.0, 0.0, 0.0, 0.0)
Square 2 bounds: PyQt4.QtCore.QRectF(0.0, 0.0, 0.0, 0.0)
Square 3 bounds: PyQt4.QtCore.QRectF(0.0, 0.0, 0.0, 0.0)

I have looked at the changes between the two versions, and I can't see
anything that would cause this to happen. Am I the only one that is
seeing this? Does anyone have any ideas on what could be going wrong?

Thanks,
Aron
-------------- next part --------------
from PyQt4 import QtCore, QtGui, QtSvg

fname = r"test.svg"
renderer = QtSvg.QSvgRenderer(fname)
print "Square 1 bounds:", renderer.boundsOnElement("square1")
print "Square 2 bounds:", renderer.boundsOnElement("square2")
print "Square 3 bounds:", renderer.boundsOnElement("square3")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.svg
Type: image/svg+xml
Size: 2737 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090427/f18929f5/test.bin


More information about the PyQt mailing list