def mousePressEvent(self, event): if event.button() is Qt.LeftButton: self.parent_object.parent_application.set_active_object(self.parent_object) QLineEdit.mousePressEvent(self, event)