1.首先给ComboBox设置view:

ui->comboBox->setView(new QListView());

2.给comboBox设置样式,可以在creater里设置,也可以调用接口 设置:

QComboBox QAbstractItemView::item { min-height: 40px;}

QComboBox设置下拉item大小

 

设置过之后运行看下效果:

这里只是设置了 高度40:

QComboBox设置下拉item大小

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2021-11-24
  • 2022-12-23
  • 2021-05-03
  • 2021-09-03
相关资源
相似解决方案