Qt总结之QSS

参考Qt帮助手册(Qt Style Sheets Reference)

  • 选择器
Universal Selector		*
Type Selector			QPushButton
Property Selector		QPushButton[flat="false"]
Class Selector			.QPushButton
ID Selector				QPushButton#okButton
Descendant Selector		QDialog QPushButton		(作用于QDialog及其子类所包含的所有QPushbutton)
Child Selector			QDialog > QPushButton	(仅作用于QDialog的直接子类QPushbutton,对QDialog派生类型所包含的QPushbutton没影响)
  • 属性
//background:
alternate-background-color
selection-background-color
background
background-color 
background-image 		(url(:/xxx))
background-repeat 		(repeat-x | repeat-y | repeat | no-repeat)
background-position		(top | bottom | left | right | center)
background-attachment 	(scroll | fixed)
background-clip 		(margin | border | padding | content)
background-origin 		(margin | border | padding | content)

//color:
color 
gridline-color 
selection-color 

//border:
border 
border-top
border-right
border-bottom
border-left

border-color 
border-top-color
border-right-color
border-bottom-color
border-left-color

border-image 

border-radius 
border-top-left-radius
border-top-right-radius
border-bottom-right-radius
border-bottom-left-radius

border-style 			(dashed | dot-dash | dot-dot-dash | dotted | double | groove | inset | outset | ridge | solid | none)
border-top-style
border-right-style
border-bottom-style
border-left-style

border-width 
border-top-width
border-right-width
border-bottom-width
border-left-width

//font:
font 
font-family
font-size
font-style				(normal | italic | oblique)
font-weight				(normal | bold | 100 | 200 ... | 900)

//margin:
margin 
margin-top
margin-right
margin-bottom
margin-left

//padding:
padding
padding-top
padding-right
padding-bottom
padding-left

//outline:
outline
outline-color
outline-offset
outline-style
outline-radius
outline-bottom-left-radius
outline-bottom-right-radius
outline-top-left-radius
outline-top-right-radius

//others
width 
height 
max-height 
max-width 
min-height 
min-width 
image 						(url(filename))
image-position 
show-decoration-selected 	(Boolean:Controls whether selections in a QListView cover the entire row or just the extent of the text.)
opacity 					(0 (transparent) to 255 (opaque))
subcontrol-origin 			(margin | border | padding | content)
subcontrol-position 
text-align 
text-decoration				(none, underline, overline, line-through)
position 					(relative | absolute)
top 
right 
bottom 
left 

button-layout 
icon-size 
spacing 
dialogbuttonbox-buttons-have-icons
lineedit-password-character 
lineedit-password-mask-delay 
messagebox-text-interaction-flags 
paint-alternating-row-colors-for-empty-area 
titlebar-show-tooltips-on-buttons} 
widget-animation-duration* 	(This property was added in Qt 5.10)
  • 伪类选择器
:active 
:adjoins-item 
:alternate 
:bottom 
:checked 
:closable 
:closed 
:default 
:disabled 
:editable 
:edit-focus 
:enabled 
:exclusive 
:first 
:flat 
:floatable 
:focus 
:has-children 
:has-siblings 
:horizontal 
:hover 
:indeterminate 
:last 
:left 
:maximized 
:middle 
:minimized 
:movable 
:no-frame 
:non-exclusive 
:off 
:on 
:only-one 
:open 
:next-selected 
:pressed 
:previous-selected 
:read-only 
:right 
:selected 
:top 
:unchecked 
:vertical 
:window 
  • subcontrol选择器
::add-line 
::add-page 
::branch 
::chunk 
::close-button 
::corner 
::down-arrow 
::down-button 
::drop-down 
::float-button 
::groove 
::indicator 
::handle 
::icon 
::item 
::left-arrow 
::left-corner 
::menu-arrow 
::menu-button 
::menu-indicator 
::right-arrow 
::pane 
::right-corner 
::scroller 
::section 
::separator 
::sub-line 
::sub-page 
::tab 
::tab-bar 
::tear 
::tearoff 
::text 
::title 
::up-arrow 
::up-button 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值