How to do - QToolButton inside the QlineEdit : Qt5
I want to add QToolButton inside the QLineEdit . I want to clear the text of QLineEdit control on that button click. For example how in google image: I have looked : This StackOverflow article But still not solved my issue. Thanks in Advance. This behaviour is available as a direct property to QLineEdit since Qt 5.2 : https://qt-project.org/doc/qt-5/qlineedit.html#clearButtonEnabled-prop QLineEdit *edit = new QLineEdit(this); edit->setClearButtonEnabled(true); You can add a custom QAction with your self-defined icons to the QLineEdit: https://qt-project.org/doc/qt-5/qlineedit.html#addAction