How to add "new line " to QString ?
-
wrote on 18 Apr 2024, 18:03 last edited by Anonymous_Banned275
I like to add new line into QString "text" passed to qDebug.
Using text += "\n" or "/n" does not work.text += " ******************"; **text += new line ???** qDebug()<<text;
-
I like to add new line into QString "text" passed to qDebug.
Using text += "\n" or "/n" does not work.text += " ******************"; **text += new line ???** qDebug()<<text;
wrote on 18 Apr 2024, 18:45 last edited by@AnneRanch
Try:qDebug().noquote() << "First line\nSecond line";
-
wrote on 19 Apr 2024, 01:35 last edited by Anonymous_Banned275
@JonB said in How to add "new line " to QString ?:
qDebug().noquote() << "First line\nSecond line";
Thanks, works as expected.
-
@JonB said in How to add "new line " to QString ?:
qDebug().noquote() << "First line\nSecond line";
Thanks, works as expected.
@AnneRanch
Mark this thread as solved then! -
wrote on 24 Jun 2024, 09:37 last edited by
QString myString = "First line\nSecond line"