# PyQt5 Line edit mouse position changed
self.line_edit.cursorPositionChanged.connect(yourfunction)
# .textChanged(), .textEdited(), .returnPressed(), .editingFinished(),
# .inputRejected(), .selectionChanged() can also be used.
# - sabz