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

相关文章

java常见报错及解决方案总结

《java常见报错及解决方案总结》:本文主要介绍Java编程中常见错误类型及示例,包括语法错误、空指针异常、数组下标越界、类型转换异常、文件未找到异常、除以零异常、非法线程操作异常、方法未定义异常... 目录1. 语法错误 (Syntax Errors)示例 1:解决方案:2. 空指针异常 (NullPoi

Qt 中 isHidden 和 isVisible 的区别与使用小结

《Qt中isHidden和isVisible的区别与使用小结》Qt中的isHidden()和isVisible()方法都用于查询组件显示或隐藏状态,然而,它们有很大的区别,了解它们对于正确操... 目录1. 基础概念2. 区别清见3. 实际案例4. 注意事项5. 总结1. 基础概念Qt 中的 isHidd

QT移植到RK3568开发板的方法步骤

《QT移植到RK3568开发板的方法步骤》本文主要介绍了QT移植到RK3568开发板的方法步骤,文中通过图文示例介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一... 目录前言一、获取SDK1. 安装依赖2. 获取SDK资源包3. SDK工程目录介绍4. 获取补丁包二

Java反转字符串的五种方法总结

《Java反转字符串的五种方法总结》:本文主要介绍五种在Java中反转字符串的方法,包括使用StringBuilder的reverse()方法、字符数组、自定义StringBuilder方法、直接... 目录前言方法一:使用StringBuilder的reverse()方法方法二:使用字符数组方法三:使用自

Qt把文件夹从A移动到B的实现示例

《Qt把文件夹从A移动到B的实现示例》本文主要介绍了Qt把文件夹从A移动到B的实现示例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学... 目录如何移动一个文件? 如何移动文件夹(包含里面的全部内容):如何删除文件夹:QT 文件复制,移动(

Python依赖库的几种离线安装方法总结

《Python依赖库的几种离线安装方法总结》:本文主要介绍如何在Python中使用pip工具进行依赖库的安装和管理,包括如何导出和导入依赖包列表、如何下载和安装单个或多个库包及其依赖,以及如何指定... 目录前言一、如何copy一个python环境二、如何下载一个包及其依赖并安装三、如何导出requirem

Qt实现发送HTTP请求的示例详解

《Qt实现发送HTTP请求的示例详解》这篇文章主要为大家详细介绍了如何通过Qt实现发送HTTP请求,文中的示例代码讲解详细,具有一定的借鉴价值,感兴趣的小伙伴可以跟随小编一起学习一下... 目录1、添加network模块2、包含改头文件3、创建网络访问管理器4、创建接口5、创建网络请求对象6、创建一个回复对

Rust格式化输出方式总结

《Rust格式化输出方式总结》Rust提供了强大的格式化输出功能,通过std::fmt模块和相关的宏来实现,主要的输出宏包括println!和format!,它们支持多种格式化占位符,如{}、{:?}... 目录Rust格式化输出方式基本的格式化输出格式化占位符Format 特性总结Rust格式化输出方式

Qt 中集成mqtt协议的使用方法

《Qt中集成mqtt协议的使用方法》文章介绍了如何在工程中引入qmqtt库,并通过声明一个单例类来暴露订阅到的主题数据,本文通过实例代码给大家介绍的非常详细,感兴趣的朋友一起看看吧... 目录一,引入qmqtt 库二,使用一,引入qmqtt 库我是将整个头文件/源文件都添加到了工程中进行编译,这样 跨平台

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

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