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 ?
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.