[Interest] smoothest way to zoom/pan QGraphicsView?

Patrick Stinson patrickkidd at gmail.com
Fri Apr 7 05:02:09 CEST 2017

> On Apr 6, 2017, at 7:57 PM, Ch'Gans <chgans at gna.org> wrote:
> 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.

This is possible. I will check further.

> Whats your environment, which HW, which OS, which Qt, …

I am using Qt-5.8.1 and PyQt-5.8.1, latest sierra with latest MacBook pro

>> 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.

How would one animate the transform without a "transform" property? Or am I missing something? (I’ve been away from qt for a while - since before the animation framework)

> Chris
>> 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