Some line edits in my UI have a FocusPolicy set to NoFocus by code at various times to prevent data from being entered. When a user clicks on a NoFocus line edit (to try to key in data), I would like to show a QToolTip explaining why the user cannot enter data. I thought about using mousePressEvent, but am unsure if it would work (because of the NoFocus issue) but even if it would work, am unsure how to code linking the line edit to the function that shows the tool tip.

My attempt to link the line edit to the tooltip function (it does not work):

Qt Code:
  1. self.ui.xyz.mousePressEvent(QMouseEvent=self.check_reminder_tooltips)
To copy to clipboard, switch view to plain text mode 

Is this the way to solve my issue, and if so, what is the correct code? If a tooltip will not work under any circumstance, an alternative would be link to a QMessageBox