当我使用此功能显示文本时
ui->plainTextEdit_2->appendPlainText()
文字看起来像这样:
**** the starting point : axis.x = 400 axis.y =220
the pipline length :12
**** turnleft point : axis.x = 388 axis.y = 220
Error points number 1: distance from begin point:6
the pipe length:17
**** turnright point : axis.x = 388 axis.y = 203
Error points number 1: distance from begin point:11
但是当我想保存文件并使用时
void MainWindow::on_actionSave_Text_triggered()
{
QString file = QFileDialog::getSaveFileName(this,"Open file name");
QFile sFile(mFilename);
if (!file.isEmpty()){
mFilename = file;
if(sFile.open(QFile::WriteOnly)| QFile::Text){
QTextStream out(&sFile);
out<< temp;
sFile.flush();
sFile.close();
}
}
}
当我打开文件时,我会保存。文本以不同的方式显示(没有下线)
**** the starting point : axis.x = 400 axis.y =220the pipline length :6**** turnleft point : axis.x = 394 axis.y = 220Error points number 1: distance from begin point:13the pipe length:23**** turnright point : axis.x = 394 axis.y = 197the pipe length:23**** turnright point : axis.x = 371 axis.y = 197Error points number 1: distance from begin point:23
what should i do to save the file and text appear in this file have structure like that:
**** the starting point : axis.x = 400 axis.y =220
the pipline length :12
**** turnleft point : axis.x = 388 axis.y = 220
Error points number 1: distance from begin point:6
the pipe length:17
**** turnright point : axis.x = 388 axis.y = 203
Error points number 1: distance from begin point:11