iyazici iyazici - 15 days ago 6
C++ Question

Accesing the stored text file in the "Text Edit", Qt C++

I create a Qt Gui application with a "pushbutton" and a "text edit". I wanna assign the text in "text edit" to a QString variable after click on the "pushbutton". How can i store this text in a QString variable ?

Answer

And why do you need a file? Just this:

QString foo = ui->textEdit->toPlainText();

Also you need to connect signal "clicked" of QPuhsButton and created slot to get text.

Comments