You will probably need to install an event filter for your entire app, that sends a custom event to all your lineEdits
when a mouse click happens. And then in the lineEdit
, and implement QObject::event()
for your lineEdit
class checking for that custom event if it is active or has focus.
I wrote up an answer that points to the documentation for filters like this:
Catching Qt modifier key releases
Hope that helps.