[Interest] Multi-line text in QLabel!
lata.agrawal at enrouteinc.com
Sat Mar 31 15:41:56 CEST 2012
I am trying to display multi-line string in QLabel. I read this string from
an XML file which is of the format:
<?xml version="1.0" encoding="UTF-8"?>
<text>*First Line\nSecond line*</text>
I don't want to use wordwrap because I want to control where to insert line
breaks in the string displayed. In code, I re-formatted the string read
from XML file as string read from XML file is converted from \n to \\n.
QStringList strList = q.questext.split("\\n");
QString strText = "";
foreach (QString str, strList)
strText = str;
strText += "\n";
qDebug("strText is %s@@@@@@\n",qPrintable(strText));
This works fine on Linux_x86 but when I run the same code on Embedded
Linux(MIPS), the string appears in a single line ignoring the line breaks.
Also the qDebug prints the formatted text properly i.e. with line breaks,
on both Linux_x86 and Linux/MIPS.
Can anyone point out whats wrong here?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest