I've a xy axis grid in OpenGL as central Widget. I want to match the coordinates(x,y) defined in the xy axis with the mouseMoveEvent() when hovering. Also coordinates should change while zooming in or out relative to OpenGL viewport. How do I acheive this?

I'm currently getting x and y coordinates by using:

Qt Code:
  1. int x = eventMove->pos().x();
  2. int y = eventMove->pos().y();
To copy to clipboard, switch view to plain text mode