【发布时间】:2014-12-23 12:06:02
【问题描述】:
我想在我的QString 中添加一个新行。我尝试使用\n,但收到“预期表达式”错误。我的代码示例如下:
if (ui->lineEdit_Company_Name->text().isEmpty())
ErrorLog = ErrorLog + "Company Name is empty", \r\n;
if(ui->lineEdit_Company_Owner->text().isEmpty())
ErrorLog = ErrorLog + "Company Owner is empty", \r\n;
【问题讨论】:
-
在 Qt 5.6 中,您需要在实际的引号内使用
\n或\r\n。