QComboBox *combobox = new QComboBox;
combobox->view()->window()->setWindowFlags(Qt::Popup|Qt::FramelessWindowHint|Qt::NoDropShadowWindowHint);
combobox->view()->window()->setAttribute(Qt::WA_TranslucentBackground);
然后通过Qss设置
QComboBox QAbstractItemView {
border-radius: 4px ;
}
如果自己重写了view,可以自己设置QListView{
border-radius:4px;
}