I use the Python-Qt bindings from PySide and I want to draw a scene with amongst others a rectangle and the rectangle is not fully visible because the view should only show a part of the scene where the rectangle is not fully contained.
Here is a minimal example:
from PySide.QtGui import *
app = QApplication([])
scene = QGraphicsScene()
scene.addRect(0, 0, 100, 100)
view = QGraphicsView(scene)
view.setSceneRect(-60, 20, 100, 100)
view.show()
app.exec_()
I expect to see the lower part of a rectangle instead I see the lower part of a triangle!
It seems like the lower right corner of the rectangle is not taken into account.
The triangle only appears for special cases (like the special scene rect in the example) and does never occur if the full rectangle is visible.
Is this a bug or am I doing something wrong? Can it be fixed?
My system: Python 3.3 + PySide 1.2.2 (64 bit) on Windows 7
view.setSceneRect(-10, -10, 120, 120)
? – Chatterton