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

相关文章

Python中连接不同数据库的方法总结

《Python中连接不同数据库的方法总结》在数据驱动的现代应用开发中,Python凭借其丰富的库和强大的生态系统,成为连接各种数据库的理想编程语言,下面我们就来看看如何使用Python实现连接常用的几... 目录一、连接mysql数据库二、连接PostgreSQL数据库三、连接SQLite数据库四、连接Mo

Git提交代码详细流程及问题总结

《Git提交代码详细流程及问题总结》:本文主要介绍Git的三大分区,分别是工作区、暂存区和版本库,并详细描述了提交、推送、拉取代码和合并分支的流程,文中通过代码介绍的非常详解,需要的朋友可以参考下... 目录1.git 三大分区2.Git提交、推送、拉取代码、合并分支详细流程3.问题总结4.git push

Kubernetes常用命令大全近期总结

《Kubernetes常用命令大全近期总结》Kubernetes是用于大规模部署和管理这些容器的开源软件-在希腊语中,这个词还有“舵手”或“飞行员”的意思,使用Kubernetes(有时被称为“... 目录前言Kubernetes 的工作原理为什么要使用 Kubernetes?Kubernetes常用命令总

Python中实现进度条的多种方法总结

《Python中实现进度条的多种方法总结》在Python编程中,进度条是一个非常有用的功能,它能让用户直观地了解任务的进度,提升用户体验,本文将介绍几种在Python中实现进度条的常用方法,并通过代码... 目录一、简单的打印方式二、使用tqdm库三、使用alive-progress库四、使用progres

基于Qt Qml实现时间轴组件

《基于QtQml实现时间轴组件》时间轴组件是现代用户界面中常见的元素,用于按时间顺序展示事件,本文主要为大家详细介绍了如何使用Qml实现一个简单的时间轴组件,需要的可以参考下... 目录写在前面效果图组件概述实现细节1. 组件结构2. 属性定义3. 数据模型4. 事件项的添加和排序5. 事件项的渲染如何使用

基于Qt开发一个简单的OFD阅读器

《基于Qt开发一个简单的OFD阅读器》这篇文章主要为大家详细介绍了如何使用Qt框架开发一个功能强大且性能优异的OFD阅读器,文中的示例代码讲解详细,有需要的小伙伴可以参考一下... 目录摘要引言一、OFD文件格式解析二、文档结构解析三、页面渲染四、用户交互五、性能优化六、示例代码七、未来发展方向八、结论摘要

Android数据库Room的实际使用过程总结

《Android数据库Room的实际使用过程总结》这篇文章主要给大家介绍了关于Android数据库Room的实际使用过程,详细介绍了如何创建实体类、数据访问对象(DAO)和数据库抽象类,需要的朋友可以... 目录前言一、Room的基本使用1.项目配置2.创建实体类(Entity)3.创建数据访问对象(DAO

Java向kettle8.0传递参数的方式总结

《Java向kettle8.0传递参数的方式总结》介绍了如何在Kettle中传递参数到转换和作业中,包括设置全局properties、使用TransMeta和JobMeta的parameterValu... 目录1.传递参数到转换中2.传递参数到作业中总结1.传递参数到转换中1.1. 通过设置Trans的

C# Task Cancellation使用总结

《C#TaskCancellation使用总结》本文主要介绍了在使用CancellationTokenSource取消任务时的行为,以及如何使用Task的ContinueWith方法来处理任务的延... 目录C# Task Cancellation总结1、调用cancellationTokenSource.

python与QT联合的详细步骤记录

《python与QT联合的详细步骤记录》:本文主要介绍python与QT联合的详细步骤,文章还展示了如何在Python中调用QT的.ui文件来实现GUI界面,并介绍了多窗口的应用,文中通过代码介绍... 目录一、文章简介二、安装pyqt5三、GUI页面设计四、python的使用python文件创建pytho