[Qt-interest] How to tell when QGraphicsView's transformation matrix has been changed?

TP wingusr at gmail.com
Tue Oct 12 09:39:53 CEST 2010


I am trying to implement an image processing application in PyQt that
will have multiple image viewers created with a subclass of
QGraphicsView. I need to be able to optionally keep all the image
viewers in sync with respect to zoom and position as the user clicks
on the scrollbars, uses the scroll wheel to zoom, uses menus to fit
the view to the window, etc.

Looking at C:\Qt\4.6.1\src\gui\graphicsview\qgraphicsview.cpp I see
that setTransform() is generally called whenever a view change occurs.
However setTransform() isn't virtual so it's not possible to override
it.

So... how does one determine when a QGraphicsView's transform has been
changed? I didn't see any applicable built-in signals, so I figured
I'd just emit my own, but now I can't quite see where to do that.

Or maybe there's an entirely different way to track changes to a
QGraphicsView's view?



More information about the Qt-interest-old mailing list