PDA

View Full Version : QGraphicsView and panning performance



prashant
27th November 2009, 17:20
Related to : PyQt 4.6.1
I have created an application using QGraphicsView & QGraphicsItem. App is visual node based shader creation tool. Here is a screen shot of a similar application

www.creativeobserver.com/img/2199_lumonix_shaderfx_3.0_plug-in_for_3ds_max_lg.jpg

Each node is sub classed QGraphicsItem and contains several other (input and output attributes) QGraphicsItem parented to it.
Zoom and Pan has been implemented using this article:

http://wiki.qtcentre.orgphp?title=QGraphicsView:_Smooth_P anning_and_Zooming#Panning

A special care has been taken in paint event of QGraphicsItem to not do unnecessary calculations inside it.
Still panning is not as smooth as it has to be.
Any pointers to smooth down panning operation?
Logically, when you start panning save the state of entire view and call it later when you finished panning or something like that.

wysota
27th November 2009, 19:40
Hard to give hints if we don't know what you already did.