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 :
But still not solved my issue.
Thanks in Advance.
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 :
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
You can add a custom QAction with your self-defined icons to the QLineEdit:
https://qt-project.org/doc/qt-5/qlineedit.html#addAction
//Create QToolButton:
Connect Signal-Slot:
Visible on Text Enter into serach box: