QTday4

任务:

 

void Widget::on_savebutn_clicked()
{
    QString editconent = ui->textEdit->toPlainText();
    QFile file("C:\\Users\\赵\\Desktop\\hello.txt");
    if(file.open(QIODevice::WriteOnly|QIODevice::Text))
    {
        QTextStream stream(&file);
        stream << editconent;
        file.close();
    }
    QMessageBox::information(this,"提示","已保存");
    this->close();
}

你可能感兴趣的:(qt)