I have a QGraphicsItem
descendant called lnk
, and I use this code to move the graphics view rect to its location into the scene:
ui->graphicsView->centerOn(lnk);
Now, I would like the view to scroll smoothly to the location of the item (like google maps for example).
Looking-up with google and stackoverflow, I found some solutions but all are based on the old API and not so clear for me.
For example, this one: Make QGraphicsView do smooth centerOn is based on old API and source code is incomplete. This one is outdated too: http://www.qtcentre.org/threads/30970-QGraphicsView-centerOn()-with-smooth-scrolling
Please help me to understand how I can get this with the new API (I guess that I must use QPropertyAnimation facility)?