PDA

View Full Version : QLabel - text in multiple colors



galhajaj
15th June 2012, 14: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, 16:09
ql->setText("<font color=\"blue\">Hello</font> <font color=\"red\">World</font><font color=\"green">!</font>");