tags:

views:

227

answers:

1

Hi All,

I wanted to change the text color of the items in QListWidget. For example, some items are in red text while others are in blue text. How do I do that? Thank you.

+6  A: 
QListWidget t;
t.addItem("first");
t.addItem("second");
t.item(0)->setForeground(Qt::red);
t.item(1)->setForeground(Qt::blue);
PiedPiper