Important: Please read the Qt Code of Conduct -

How to color in textbrowser

  • hi...
    How can I color text in LineEdit or TextBrowser

    suppose i have
    QString message="hello";
    how can i color the message..
    Thanks in advance

  • You can enclose the text in html span tags and add the color:

    QString message = "<span style='color: red'>hello</span>"

Log in to reply