PDA

View Full Version : transparent qcombobox?



eric_vi
2nd November 2009, 20:47
how is it possible to make the background of the dropdown list of a QComboBox semi transparent?

thank you in advance for your help

wysota
2nd November 2009, 22:20
What did you already try?

eric_vi
2nd November 2009, 22:59
i tried


cbox->view()->setWindowOpacity(.5);


and also


QPalette pal = cbox->view()->palette();
pal.setBrush(QPalette::Base, Qt::transparent);
cbox->view()->setPalette(pal);




both does not work

wysota
2nd November 2009, 23:02
Try using Qt::WA_TranslucentBackground.

eric_vi
3rd November 2009, 00:43
it does not make any difference...

i am in style plastique, i got the feeling a background color is written first then the 50% opacity is added on top.. how to make sure there is no background paint on this wiget

wysota
3rd November 2009, 08:27
You may have to provide a custom delegate to the view. One that does not paint the background or does it with translucency.