Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to use font color in Qstring
prankur.sarbhai last edited by
Later it get updated as follows with "connected" shown in red font:
I was using QString text(tr(" - <FONT COLOR=red>Connected</FONT>")); for addeing connected in bewteen the string
Till here it was working fine.
Somehow the problem started when i start using "<>" in string other then font color change. Can someone please explain me what I am doing wrong and how to correct this problem.
Using <> like that you are creating an opening tag with no ending so you are creating an invalid html document. You have to escape this character if you want to use it "as is"
butterface last edited by
Shouldn't there be <html> and </html> as well?
IIRC, no. Maybe using the terms "html document" is not the best description. You can do rich text with QLabel but it's not a browser.