英文:
Combo box css in Qt
问题
我想让Qt中的这个组合框看起来像Figma中设计的那个组合框。我对CSS不太擅长。
英文:
I want to make this combo box in Qt look like this designed combo box in Figma. I'm not that good with CSS.
This is the original combo box in Qt :
答案1
得分: 2
这里我将原始外观设为无,然后为其创建自定义按钮,以下是代码部分:
CSS:
.select-menu{
appearance: none;
padding: 10px 30px 10px 10px;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #f2f2f2;
background-image: url(arrow.svg);
background-repeat: no-repeat;
background-position: center right 25%;
background-size: 20px;
color: #333;
width: 130px;
}
.select-menu::-ms-expand{
display: none;
}
英文:
this one i make the original appearance none then i make custom button for it this the code
css:
.select-menu{
appearance: none;
padding: 10px 30px 10px 10px;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #f2f2f2;
background-image: url(arrow.svg);
background-repeat: no-repeat;
background-position: center right 25%;
background-size: 20px;
color: #333;
width: 130px;
}
.select-menu::-ms-expand{
display: none;
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论