Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to specify multiple HTML-style markup for text[solved] ?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 3.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vivek.narvekar
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • P Offline
      P Offline
      p-himik
      wrote on last edited by
      #2

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

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

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        This is basic HTML formatting.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vivek.narvekar
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vivek.narvekar
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • EddyE Offline
              EddyE Offline
              Eddy
              wrote on last edited by
              #6

              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.

              Qt Certified Specialist
              www.edalsolutions.be

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #7

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

                1 Reply Last reply
                0
                • V Offline
                  V Offline
                  vivek.narvekar
                  wrote on last edited by
                  #8

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

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved