Display Grid Co ordinates values

Hello,
I am using Open cascade in Qt Qml for drawing lines. I have activated the grid and also I am able to do drawing.

But I need to display the x y co ordinates values for the grid at the corner of the window as per the attached image.
When I zoom in / out the co ordinates values should change based on zoom factor.

Could any one please help me to display the co ordinates values for the grid at the corner of the window ?

Attachments: