Essentially this post describes the problem however the answers are for c++ and I'd like to know if there is a way to do this in python.
Turning a lineedit into readOnly mode also disables the clearButton and I wondered if it is possible to keep the clearButton functionality active. Is it possible to extend the action that gets triggered on a clearButton click with some custom functionality (if it is possible to access the clearbutton at all)?