How to specify multiple HTML-style markup for text[solved] ?
-
wrote on 4 Nov 2011, 09:43 last edited by
Hello,
If I need to make a text bold, then I can give
<b>Hello</b>
if I need blue color for the text, then I can give
<font color=blue>Hello</font>But how to combine these tags ?
ie what to do if, i want a text in blue color and it should be bold ?
Thanks for help
vivek -
wrote on 4 Nov 2011, 09:48 last edited by
What about
@<b><font color="blue">Hello</font></b>@
?It works with QLabel (if your question has any relation to it).
-
wrote on 4 Nov 2011, 09:49 last edited by
This is basic HTML formatting.
-
wrote on 4 Nov 2011, 09:54 last edited by
Thanks a lot for responding.
Actually I am not much aware of HTML.
But my actual problem is as follows.
When i give color to text using this,
<font color="blue">ExampleText</font>,
the text wraps in the available label space. so i was hoping to find a similar HTML tag which would prevent it from wrapping and club it with this color tag.My text is not english, but its a translated text in japanese.
-
wrote on 9 Nov 2011, 07:00 last edited by
Got the solution for text wrapping problem.
when we use HTML tags, it gets converted to rich text. and rich text has a problem of wrapping.
Hence, instead used ForegroundColor() method to set the color to label text.Note that I am using Qt3, maybe things work Ok in new qt.
Thank a lot for all the help.
by the way, I have not yet found, how to set the status of our queries to [solved] ?
-
wrote on 9 Nov 2011, 07:05 last edited by
bq. by the way, I have not yet found, how to set the status of our queries to [solved] ?
You can use the edit link in you first post ( under your name) and add [solved] in the title.
-
wrote on 9 Nov 2011, 08:18 last edited by
[quote author="vivek.narvekar" date="1320822048"]Note that I am using Qt3, maybe things work Ok in new qt.[/quote]
Next time, please state that expliciitly and clearly. The vast majority of users here are on Qt 4, and for most answers, will assume you are on the latest released version (4.7.4). It is usually not a big problem if you are on an earlier 4.x version, but 3 has many major differences with 4.These issues will only get bigger once a first version of Qt 5 is released... Perhaps the time to upgrade has come?
-
wrote on 9 Nov 2011, 09:18 last edited by
I'll keep that in mind.
Yes, surely we are upgrading soon.
thank you
5/8