Hi, I am new to PyQt. I am designing an paint interface using PyQt5. For that, I made a class gui(QMainWindow). Then I added a QLabel through qtDesigner and named it imageLabel. So far so good. But now I need the position of mouse click relative to the QLabel (imageLabel).

I know that in order to get the mouse click position from the QMainWindow i need to call this:
def mousePressEvent(self, event):
if event.button() == Qt.LeftButton:
self.lastPoint= event.pos()

This gives me the position that is indexed from the top of the QMainWindow, I don't need that. I need mouse position starting relative to my QLabel. This is needed because, I am creating a dynamic label, so upon resizing the window, the position of QLabel will change (hence I can't hard code anything)

Screenshot (28).jpg See, the white window is where I would like to paint.

How do I get the position of mouse from this QLabel/QImage.