Getting QCanvasItems to work this way is hard; QCanvas indexes items based on their geometry relative to the canvas, and it assumes that items stay the same size regardless of QCanvasView's transformation. Whereas if the item should stay the same size regardless of the transformation, that means the view owns the item's geometry, not the canvas. So QCanvas would claim that items were at one spot, whereas the view would actually render them somewhere else.
You _can_ make this work, but you need to hijack QCanvasView:aintEvent() and do _all_ the rendering yourself. If you want to interact with the items, you also need to write subtle code in QCanvasView::mouse*Event() handlers. It's very hard to get right, unfortunately. But possible. An easier approach might be to just reimplement QCanvasView:
aintEvent() and draw your untransformed shapes directly after calling QCanvasView's base paintEvent implementation.
Unfortunately, QCanvas doesn't help you a lot in this sense; it simply wasn't designed to support such items.
[Fyi: In Qt 4, all this trouble is hidden behind a simple flag: QGraphicsItem::ItemIgnoresTransformations. If you set it on an item, the item will remain the same size (w/transformations) regardless of the view. And interaction works like normal.]
Bookmarks