[Interest] smoothest way to zoom/pan QGraphicsView?

Ch'Gans chgans at gna.org
Fri Apr 7 04:57:47 CEST 2017

On 7 April 2017 at 14:38, Patrick Stinson <patrickkidd at gmail.com> wrote:
> I am implementing a pan and zoom on pinch via raw touch events and am finding setTransform() to be very slow, even with an empty scene. The touch events are backed up in a queue by slow synchronous calls to QGraphicsView.setTransform().

If it's slow with an empty scene, then you have a problem that has
nothing to do with QTransform. Maybe you have a cascade of events that
bounce on each other until it stabilise...
Maybe your synchronous calls are too frequent. I would advise to use
the animation framework to do this sort of things.

Whats your environment, which HW, which OS, which Qt, ...

> Without stripping down my code into a runnable example, is setTransform considered to be too slow for 60Hz frame-rate updates from touch events? If so, is there a better way to smoothly zoom and pan the graphics view?

Use the animation framework. no need for a queue mechanism, should
work without any problems unless you hardware is not powerful enough.


> Thanks!
> -P
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

More information about the Interest mailing list