Skip to content

Instantly share code, notes, and snippets.

@esmarr58
Created January 25, 2018 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esmarr58/17ad7fd6596a826cf27e827aa678a17a to your computer and use it in GitHub Desktop.
Save esmarr58/17ad7fd6596a826cf27e827aa678a17a to your computer and use it in GitHub Desktop.
void MainWindow::on_pushButton_clicked()
{
QString nombreArchivo = ui->TextoNombre->text();
QString contenidoArchivo = ui->TextoArchivo->toPlainText();
QFile archivo(nombreArchivo);
if(archivo.open(QIODevice::WriteOnly | QIODevice::Text)){
QTextStream datosArchivo(&archivo);
datosArchivo << contenidoArchivo << endl;
}
archivo.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment