self.comboBox_marital = QComboBox(self)
mar_list_view = QListView()
self.comboBox_marital.setView(mar_list_view)
self.comboBox_marital.addItem("已婚")
self.comboBox_marital.addItem("未婚")
self.comboBox_marital.setStyleSheet("""
  QComboBox{font-family:Microsoft YaHei;border:1px;border-color#252525:border-radius:2px;background: #404040;font:12px;color:white;height: 20px;}
  QComboBox:editable{background:black;}
  QComboBox QAbstractItemView{border: 0px;outline:0px;selection-background-color: blue;height:100px;background: rgb(1,58,80);color:white;font-size:12px}
  QComboBox QAbstractItemView::item {height:30px;}
  QComboBox QAbstractItemView::item:selected{background-color: blue;}
  QComboBox::down-arrow{image:url(application/resources/icons/combo_arrow.png);}
  QComboBox::drop-down{border:0px;}
""")
self.comboBox_marital.setCurrentIndex(-1)

下拉箭头:PyQt样式表设置QComboBox

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2021-11-14
  • 2021-10-18
  • 2021-11-14
猜你喜欢
  • 2022-12-23
  • 2021-04-23
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2021-05-03
  • 2022-12-23
相关资源
相似解决方案