如题,如何设置QComboBox下拉框的背景颜色和文字颜色?
------解决方案--------------------

------解决方案--------------------
要在cpp里面加:
#include <QStyledItemDelegate>
QStyledItemDelegate* itemDelegate = new QStyledItemDelegate();
ui->comboBox->setItemDelegate(itemDelegate);
QSS部分:
QComboBox QAbstractItemView{
xxxx
}
具体的可以去看QAbstractItemView的stylesheet