本文开发语言:Python-PyQt5
效果图:
combobox_obj = QComboBox(objectName="comboboxObj")
combobox_obj.setStyleSheet("""
#comboboxObj{
background-color: rgb(178,200,187);
border: 1px solid rgb(200, 200, 200);
color: rgb(7,99,109);
font-weight: bold;
}
#comboboxObj QAbstractItemView::item{
height:20px;
}
#comboboxObj::drop-down{
border: 0px;
}
#comboboxObj::down-arrow{
image:url("combobox/more.png");
width: 15px;
height:15px;
}
""")
# 最后需设置一下listView
combobox_obj.setView(QListView())
2 QPushButton样式美化
# 没有写其他普通的东西,只记录了个比较特别的设置
# 圆角设置(直接使用border-radis是无效的)
button_obj.setStyleSheet("border-top-left-radius:5px;border-bottom-right-radius:5px;")
# 以此类推其他的两个角,需要哪个写哪个。