QCombobox组合框的样式

4 篇文章 0 订阅

QComboBox

{

width: 400px;  //整个组合框的宽度 设置后在ui编辑器中即可用看见效果

min-width: 250px; 

max-width: 500px;

height: 600px;

border-radius: 3px;//  边框的圆角

border: 12px;

font-size: 12pt;

font-family: 微软雅黑,宋体;

background-repeat: no-repeat;

background-position: center left;

padding-left: 42px;

color: white; //该处的color是,组合框中的编辑框中文本的颜色。---------------------------------------

selection-color: black;

selection-background-color: darkgray;

}

 

QComboBox::drop-down //组合框右侧的下三角按钮

{

background-color: black; //该下三角按钮的背景色

min-width: 200px; //下三角按钮的最小宽度

}

 

/*

 

Descendant SelectorQDialog QPushButtonMatches all instances of QPushButton that are descendants (children, grandchildren, etc.) of aQDialog.

下面的形式是一种选择符,因为QComboBox的下拉列表框实际上是一个QListWidget部件,而QListWidget部件又派生自QListView,QListView又派生自QAbstractItemView类。

*/

QComboBox QAbstractItemView

{

height:1000px;//下拉列表框的高度 即item所在的下拉列表区域-------------

border: 12px; 

color: red;  //组合框中的item的颜色  //跟QComboBox中的color区分开来-------------------------------------------

selection-color: green;  //鼠标选中该item的颜色

selection-background-color: darkgrey;  //鼠标选中该item的背景色

 

padding:30px,30px,30px,30px;//此处的效果是 listWidget部件与QCombox中edit编辑框的距离 以及 与 combobox底部的距离

}

QComboBox QAbstractItemView::item

{

height: 100px;

min-height:100px;

}

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值