Qt 5.2 introduced a clearButton property. Is this what you mean?

https://doc.qt.io/qt-5/qlineedit.htm...onEnabled-prop