I am looking to find how to zoom in a QGraphicsView but on the cursor position. Currently I am able to zoom but the position it is zooming onto is not consistent.
def wheelEvent(self, event):
'''Wheel event to zoom
'''
# Run default event
QtWidgets.QGraphicsView.wheelEvent(self, event)
# Define zoom factor
factor = 1.1
if event.delta() < 0:
factor = 0.9
self.scale(factor, factor)
I have seen the use of self.mapToScene()
but have been unsuccessful