码迷,mamicode.com
首页 > 其他好文 > 详细

QComboBox样式表:字体、图标、项高

时间:2018-01-24 15:26:39      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:ima   led   over   add   微软雅黑   str   control   styles   com   

		QComboBox *cmBox = new QComboBox();
		cmBox->setStyleSheet("QComboBox{font-family:‘微软雅黑‘;font-size:9; border:1px solid lightgray;}"
			"QComboBox QAbstractItemView::item {min-height: 20px;}"
			"QComboBox::drop-down{border-left-width: 1px;border-left-color: lightgray;border-left-style: solid; border-top-right-radius: 3px;border-bottom-right-radius: 3px;subcontrol-origin: padding;subcontrol-position: top right; width:20px;}"
			"QComboBox::down-arrow{image:url(:/FlightSimCaptain/Resources/down_arrow.png)}"
			"QComboBox::down-arrow:hover{image:url(:/FlightSimCaptain/Resources/down_arrow_press.png)}"
			"QComboBox::down-arrow:pressed{image:url(:/FlightSimCaptain/Resources/down_arrow_press.png)}");
		cmBox->addItem("04");
		cmBox->addItem("22");
		QStyledItemDelegate *delegate = new QStyledItemDelegate(this);
		cmBox->setItemDelegate(delegate);

  

QComboBox样式表:字体、图标、项高

标签:ima   led   over   add   微软雅黑   str   control   styles   com   

原文地址:https://www.cnblogs.com/loki1412/p/8341310.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!