设置QComboBox下拉框子项高度

#include "widget.h"
#include "ui_widget.h"
#include 
Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->comboBox->setStyleSheet("QComboBox { min-height: 40px; min-width: 60px; }"
    "QComboBox QAbstractItemView::item { min-height: 40px; min-width: 60px; }");
    ui->comboBox->setView(new QListView());
}

Widget::~Widget()
{
    delete ui;
}

你可能感兴趣的:(VS-Qt工作总结)