QString fname;
fname=QFileDialog::getOpenFileName(this,"Open Txt File","","Txt File(*.txt)");
QFile file(fname);
textEdit->setReadOnly(true);
if (file.open(QIODevice::ReadOnly)) {
textEdit->setText(file.readAll());
}
file.close();
qt4:读取文本文件
最新推荐文章于 2024-08-26 11:25:50 发布