PDA

View Full Version : QComboBox: how to change background color of pull down menu



jasonhxs
8th March 2015, 04:04
Hi,

I use QComboBox, I want to change the background color of pull down menu to white (defaut is gray).
Also do you know how to set tip for each highlight item (some item's wording maybe too long).
Thanks~

west
8th March 2015, 10:45
http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qcombobox

jasonhxs
9th March 2015, 12:02
Hi,

Thanks for the suggestion, now I can do it by style sheet setting:
setStyleSheet("QComboBox_C QAbstractItemView{background:white}");

BTW, I try to aut0-ajust the width of pull down menu according to inserted item, any idea?