[Interest] Multi-line text in QLabel!

1+1=2 dbzhang800 at gmail.com
Sun Apr 1 01:38:01 CEST 2012


Why it does not work is that the text you wrote is wrong in richText.

First Line <br /> Second line.

and In Xml, you  need to escape it too.

On Sat, Mar 31, 2012 at 7:05 AM, Lata Agrawal
<lata.agrawal at enrouteinc.com> wrote:
> Hi Bob,
>
> I changed text in XML like this:
>
> <text><br>First Line</br>Second line</text>
>
> Its still displaying in a single line.
>
> SOLVED: But I found the mistake in my code. I had set QLabel have the
> RichText text format. I removed that and its working now.
> Hope that will help someone. if there is a better way of doing it, please
> let me know.
>
> Thanks & Regards,
> Lata
>
>
> On 31 March 2012 19:25, Bob Hood <bhood2 at comcast.net> wrote:
>>
>> On 3/31/2012 7:41 AM, Lata Agrawal wrote:
>> > 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.
>>
>> I'd probably try changing "\n" to "<br>" and see what that does.
>>
>>
>>
>> Render me gone,                       |||
>> Bob                                 ^(===)^
>>
>> ---------------------------------oOO--(_)--OOo---------------------------------
>>    I'm not so good with advice...can I interest you in a sarcastic
>> comment?
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>
>
>
>
> --
>
>
> Lata Agrawal
> Senior Developer
> 9699750643
> En Route Media Pvt. Ltd.
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>



More information about the Interest mailing list