Qt总结之QSS

2024-04-09 19:32
文章标签 总结 qt qss

本文主要是介绍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-leftborder-color 
border-top-color
border-right-color
border-bottom-color
border-left-colorborder-image border-radius 
border-top-left-radius
border-top-right-radius
border-bottom-right-radius
border-bottom-left-radiusborder-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-styleborder-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 

这篇关于Qt总结之QSS的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/889031

相关文章

SQL中JOIN操作的条件使用总结与实践

《SQL中JOIN操作的条件使用总结与实践》在SQL查询中,JOIN操作是多表关联的核心工具,本文将从原理,场景和最佳实践三个方面总结JOIN条件的使用规则,希望可以帮助开发者精准控制查询逻辑... 目录一、ON与WHERE的本质区别二、场景化条件使用规则三、最佳实践建议1.优先使用ON条件2.WHERE用

Nginx Location映射规则总结归纳与最佳实践

《NginxLocation映射规则总结归纳与最佳实践》Nginx的location指令是配置请求路由的核心机制,其匹配规则直接影响请求的处理流程,下面给大家介绍NginxLocation映射规则... 目录一、Location匹配规则与优先级1. 匹配模式2. 优先级顺序3. 匹配示例二、Proxy_pa

Android学习总结之Java和kotlin区别超详细分析

《Android学习总结之Java和kotlin区别超详细分析》Java和Kotlin都是用于Android开发的编程语言,它们各自具有独特的特点和优势,:本文主要介绍Android学习总结之Ja... 目录一、空安全机制真题 1:Kotlin 如何解决 Java 的 NullPointerExceptio

VS配置好Qt环境之后但无法打开ui界面的问题解决

《VS配置好Qt环境之后但无法打开ui界面的问题解决》本文主要介绍了VS配置好Qt环境之后但无法打开ui界面的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要... 目UKeLvb录找到Qt安装目录中designer.UKeLvBexe的路径找到vs中的解决方案资源

MySQL基本查询示例总结

《MySQL基本查询示例总结》:本文主要介绍MySQL基本查询示例总结,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录Create插入替换Retrieve(读取)select(确定列)where条件(确定行)null查询order by语句li

Qt之QMessageBox的具体使用

《Qt之QMessageBox的具体使用》本文介绍Qt中QMessageBox类的使用,用于弹出提示、警告、错误等模态对话框,具有一定的参考价值,感兴趣的可以了解一下... 目录1.引言2.简单介绍3.常见函数4.按钮类型(QMessage::StandardButton)5.分步骤实现弹窗6.总结1.引言

Qt中Qfile类的使用

《Qt中Qfile类的使用》很多应用程序都具备操作文件的能力,包括对文件进行写入和读取,创建和删除文件,本文主要介绍了Qt中Qfile类的使用,具有一定的参考价值,感兴趣的可以了解一下... 目录1.引言2.QFile文件操作3.演示示例3.1实验一3.2实验二【演示 QFile 读写二进制文件的过程】4.

Linux区分SSD和机械硬盘的方法总结

《Linux区分SSD和机械硬盘的方法总结》在Linux系统管理中,了解存储设备的类型和特性是至关重要的,不同的存储介质(如固态硬盘SSD和机械硬盘HDD)在性能、可靠性和适用场景上有着显著差异,本文... 目录一、lsblk 命令简介基本用法二、识别磁盘类型的关键参数:ROTA查询 ROTA 参数ROTA

Qt实现网络数据解析的方法总结

《Qt实现网络数据解析的方法总结》在Qt中解析网络数据通常涉及接收原始字节流,并将其转换为有意义的应用层数据,这篇文章为大家介绍了详细步骤和示例,感兴趣的小伙伴可以了解下... 目录1. 网络数据接收2. 缓冲区管理(处理粘包/拆包)3. 常见数据格式解析3.1 jsON解析3.2 XML解析3.3 自定义

C++如何通过Qt反射机制实现数据类序列化

《C++如何通过Qt反射机制实现数据类序列化》在C++工程中经常需要使用数据类,并对数据类进行存储、打印、调试等操作,所以本文就来聊聊C++如何通过Qt反射机制实现数据类序列化吧... 目录设计预期设计思路代码实现使用方法在 C++ 工程中经常需要使用数据类,并对数据类进行存储、打印、调试等操作。由于数据类