#include #include void setColor(QListWidgetItem *w, QString value) { w->setTextColor(value); } int main(int argc, char *argv[]) { QApplication a(argc, argv); // Init QListWidget *l = new QListWidget(0); QListWidgetItem *i1 = new QListWidgetItem("1"), *i2 = new QListWidgetItem("2"), *i3 = new QListWidgetItem("3"); // Set Colors setColor(i1, "orange"); setColor(i2, "white"); setColor(i3, "red"); // Add items & show l->addItem(i1); l->addItem(i2); l->addItem(i3); l->setStyleSheet("QListWidget::item { background-color: blue; }"); l->show(); // Set Index to first row, as QListWidget is the only selectable widget on the screen // It shows the first row as being selected, while it is not really (another bug?) // You can see this by uncommenting the following line l->setCurrentRow(0); return a.exec(); }