How to get precise mouse pointer location/coordinate in PyQt5 QPainter? I am trying to draw rectangle in real time in pyqt5 Using QPainter class.