Smooth zooming with mouse pointer as center
Hi,
No matter what I do, the zoom in my GraphicsView is always happening in the same manner, which doesn't take my mouse pointer into consideration.
Basically I want the zoom to happen like google maps. And I did try with the approach provided here.
As a standalone GraphicsView it works perfectly. But in my project, I have a graphWidget (a custom class inheriting QGraphicsView) and a tabWidget separated by a splitter. (designed in UI forms). And in the code, I initialize the graphicsView.
I added the same wheelEvent implementation to my graphicsView class, but it doesnt show any difference. It always zooms in the same way, without caring about mouse position.
Any help ?
Let me know if more details are needed.
Re: Smooth zooming with mouse pointer as center
Hi,
have you tried to set the QGraphicsView::transformationAnchor to QGraphicsView::AnchorUnderMouse?
Re: Smooth zooming with mouse pointer as center
yes of course. As I said, it works if I test with the example in the link I posted. But in my project, the same code doesnt work. Don't understand why.