qss + delegate:QComboBox Item Height

THE MOST IMPORTANT IS TO SET THE DELEGATE,IF NOT, THE STYLE WILL TO WORKS.

QStyledItemDelegate * itemDelegate = new QStyleItemDelegate();

ui.combox->setItemDelegate(itemDelegate);

 

QSS:

ui.combox->setStyleSheet("QComboBox QAbstractItemView::item

{min-height:30px;background:#121D55;color:#FFFFFF;font-family:Arial;font-size:12px}");

你可能感兴趣的:(Qt工作中经验总结)