// A slot to QListWidget's currentItemChanged // The textColor was set on the QListWidgetItem as shown in the attached example main.cpp source code void ::currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous) { if(current) { QPalette p = l->palette(); p.setColor(QPalette::HighlightedText, current->textColor()); l->setPalette(p); } }