[Qt-interest] Detect hand scrolling in QGraphicsItem::paint()

Stephen Chu stephen at ju-ju.com
Tue Oct 27 15:33:04 CET 2009


That's it. Thanks a lot!

On 10/27/09 3:54 AM, Riccardo Roasio wrote:
> Using this should be helpful?
> 
> virtual void *mouseMoveEvent 
> <http://doc.trolltech.com/4.2/qgraphicsitem.html#mouseMoveEvent>* ( 
> QGraphicsSceneMouseEvent * /event/ )
> 
> You can catch it and set something like a bool flag to true.
> 
> So you can test for the flag during painting...
> 
> Riccardo
> 
> 2009/10/26 Stephen Chu <stephen at ju-ju.com <mailto:stephen at ju-ju.com>>
> 
>     Is there a way to know if the current call to my paint() function is
>     during a user hand scrolling?
> 
>     I am displaying a huge image and want the app to be responsive while
>     user is drag-scrolling the image. The idea is to plot only a low-res
>     version of the image while the user is dragging it around and repaint it
>     with proper res one after the user let go of the button.
> 
>     So basically I need to know when the user starts and stops hand-dragging
>     the QGraphicsView that contains my custom QGraphicsItem.
> 
>     Thanks.
> 
>     --
>     Stephen Chu
>     _______________________________________________
>     Qt-interest mailing list
>     Qt-interest at trolltech.com <mailto:Qt-interest at trolltech.com>
>     http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
>

-- 
Stephen Chu



More information about the Qt-interest-old mailing list