PDA

View Full Version : How to clear data from LineEdit after pressing PushButton?



Aakash Goel
7th August 2014, 21:16
I had made an user interface in which i have 1)lineEdit 2) pushButton.

I Want that after pressing push button data written by user in LineEdit would be cleared.

For this, i have construct this code but note working:-

QString a;
a=ui->lineEdit->text;
a.clear();


Please Reply!!
Thanks in advance!!

anda_skoa
8th August 2014, 06:03
That clears the string, if you want to clear the line edit, call its clear() method, i.e. QLineEdit::clear().

Cheers,
_