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. Coloring the QString
QtWS25 Last Chance

Coloring the QString

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 4.1k 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.
  • B Offline
    B Offline
    BibekKumar
    wrote on last edited by
    #1

    @QString text("<FONT COLOR=red>%1</FONT>");
    text.arg(strMat);
    QDomNode text_node
    text_node.setNodeValue(text);@

    I have the above code . what i want is text color shall be red and that text value shall be decided during the run time .

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

      Using HTML to color a text can work, but in a QDomNode? I don't get that. QDomNode is not for displaying...

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BibekKumar
        wrote on last edited by
        #3

        My requirement is to coloring the QString then setting that color text in QDomNode .
        that is the thing i want to do in the above code .
        But i am not able to know why its not working .

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

          But having a colored string in a domnode is nonsense. Color is a display property, and a QDomNode is not displayed. How do you even check if your coloring worked if you can't display it?

          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