PDA

View Full Version : Changing the color of the selection in a QListWidget



Luc4
22nd February 2010, 09:09
Hi! How do I change the color of the selection of a QListWidget? I came up with this but it doesn't work:


QPalette p = QPalette(skinsListView->palette());
p.setColor(QPalette::Highlight, QColor(22, 22, 123));
skinsListView->setPalette(p);

high_flyer
22nd February 2010, 09:38
try QListWidgetItem::setBackground()
http://doc.trolltech.com/4.6/qlistwidgetitem.html#setBackground