PDA

View Full Version : QLabel - text in multiple colors



galhajaj
15th June 2012, 13:58
Hello :)
how can i set multiple colors inside Qlabel text?
for example:
QLabel ql;
ql->setText("Hello World!");

i want that the "Hello" will be in blue, the "World" in red & the "!" in green
it is possible?
thanks in advance,
Gal

wysota
15th June 2012, 15:09
ql->setText("<font color=\"blue\">Hello</font> <font color=\"red\">World</font><font color=\"green">!</font>");