How to specify multiple HTML-style markup for text[solved] ?



  • 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



  • What about
    @<b><font color="blue">Hello</font></b>@
    ?

    It works with QLabel (if your question has any relation to it).



  • This is basic HTML formatting.



  • 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.



  • 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] ?


  • Moderators

    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.



  • [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?



  • I'll keep that in mind.
    Yes, surely we are upgrading soon.
    thank you


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.