Thanks @Ginsengelf. Yes, the function you suggested worked. Thanks a ton.

Here is the code for others to refer:

def mousePressEvent(self, event):
if event.button() == Qt.LeftButton & self.globalDrawing==True:
self.drawing=True
self.lastPoint= event.pos()
self.lastPoint=self.imageLabel.mapFromParent(event .pos()) #this is working fine now
self.imageLabel.setPixmap(QPixmap.fromImage(self.i mage))

def mouseMoveEvent(self,event):
if (event.buttons() & Qt.LeftButton) & self.drawing &self.globalDrawing:
painter=QPainter(self.image)
painter.setPen(QPen(self.brushColor,self.brushSize ,Qt.SolidLine,Qt.RoundCap,Qt.RoundJoin))
painter.drawLine(self.imageLabel.mapFromParent(eve nt.pos()),self.lastPoint)
self.lastPoint=self.imageLabel.mapFromParent(event .pos()) #this is working fine now
self.imageLabel.setPixmap(QPixmap.fromImage(self.i mage))
def mouseReleaseEvent(self,event):
if event.button == Qt.LeftButton & self.globalDrawing:
self.drawing = False
self.imageLabel.setPixmap(QPixmap.fromImage(self.i mage))