Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    4
    8
    2789
    Loading More Posts
    • 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
      vivek.narvekar 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

      1 Reply Last reply Reply Quote 0
      • P
        p-himik last edited by

        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 Reply Quote 0
        • A
          andre last edited by

          This is basic HTML formatting.

          1 Reply Last reply Reply Quote 0
          • V
            vivek.narvekar 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.

            1 Reply Last reply Reply Quote 0
            • V
              vivek.narvekar 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] ?

              1 Reply Last reply Reply Quote 0
              • E
                Eddy 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.

                Qt Certified Specialist
                www.edalsolutions.be

                1 Reply Last reply Reply Quote 0
                • A
                  andre 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?

                  1 Reply Last reply Reply Quote 0
                  • V
                    vivek.narvekar last edited by

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

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post