PDA

View Full Version : How to set QListView Opacity ,setWindowOpacity dosn’t work



umen
25th May 2010, 10:02
Hi
im trying to set opacity to QListView , that sits on QDialog
i mange to set the QDialog transperant with setting the
:Qt::WA_TranslucentBackground = true
but the QListView doesn't become transparent with i set the
setWindowOpacity to 1 or 0

saa7_go
7th June 2010, 12:46
try this:



QPalette pal = listView->palette();
pal.setColor(QPalette::Base, Qt::transparent);
listView->setPalette(pal);

saa7_go
7th June 2010, 12:47
try this:



QPalette pal = listView->palette();
pal.setColor(QPalette::Base, Qt::transparent);
listView->setPalette(pal);