Hii all..
Can I know how to add a clear button to a QLineEdit ?
Thank You
Jayakrishna Reddy
Printable View
Hii all..
Can I know how to add a clear button to a QLineEdit ?
Thank You
Jayakrishna Reddy
Check this - Lineedit with Clear Button
Hi, I guess you have a designer. If so, just add a button from the designer and just connect it to a slot as the following;
Code:
connect( yourClearButton, SIGNAL(clicked()), this, SLOT(clearButtonClickedSlot()) );
and just implement the SLOT
Code:
void Foo::clearButtonClickedSlot() { mUi->yourLineEdit->setText(""); }
Oh I didn't know the clear thing..you're right.
By the way, right about the last comment of yours as well I guess.
Sorry..that is not the case. I am asking about how to add a clear button to a QLineEdit using cascading style sheets. So that I can display the clear button on the lineedit in the hover state.
You will need to make your custom widget.
Also the link I gave before,, the code link seems to be invalid now...:(