SOLVED: Per the advice of an expert, instead of changing the FocusPolicy of the line edit to NoFocus, I used lineEdit.setReadOnly(True), and it works.