January 7, 2011

endla.ravi endla.ravi
Lab Rat
17 posts

How to color in textbrowser

 

hi…
How can I color text in LineEdit or TextBrowser

suppose i have

  1. QString message="hello";
  2. ui->textBrowser->append(message);
  3.    

how can i color the message..
Thanks in advance

1 reply

January 7, 2011

Volker Volker
Ant Farmer
5428 posts

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

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

 
  ‹‹ [SPLIT] Future of Widgets in Qt      Can anyone point me to example code for playing a movie using the Qt Multimedia API? ››

You must log in to post a reply. Not a member yet? Register here!