Hii all..
Can I know how to add a clear button to a QLineEdit ?
Thank You
Jayakrishna Reddy
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;
Qt Code:
connect( yourClearButton, SIGNAL(clicked()), this, SLOT(clearButtonClickedSlot()) );To copy to clipboard, switch view to plain text mode
and just implement the SLOT
Qt Code:
void Foo::clearButtonClickedSlot() { mUi->yourLineEdit->setText(""); }To copy to clipboard, switch view to plain text mode
in this case you can simply use one connection
Qt Code:
connect( yourClearButton, SIGNAL(clicked()), mUi->yourLineEdit, SLOT(clear()) );To copy to clipboard, switch view to plain text mode
but I think author needs clear-button like aamer4yu suggested.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
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...
Bookmarks