Hello I want to write a text in a QFile , for example /home/hello.txt.
Does anybody know any example of code for doing it ?
Thanks
Gorka
Printable View
Hello I want to write a text in a QFile , for example /home/hello.txt.
Does anybody know any example of code for doing it ?
Thanks
Gorka
Yes, I do. And also the documentation. Search it!
here .. try this one:
Code:
void MainWindow::on_pushButton_clicked() { if(!outputFile.isOpen()) { //alert that file did not open } outStream << str; outputFile.close(); //open text file to user }