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

相关文章

Windows Docker端口占用错误及解决方案总结

《WindowsDocker端口占用错误及解决方案总结》在Windows环境下使用Docker容器时,端口占用错误是开发和运维中常见且棘手的问题,本文将深入剖析该问题的成因,介绍如何通过查看端口分配... 目录引言Windows docker 端口占用错误及解决方案汇总端口冲突形成原因解析诊断当前端口情况解

Qt中QGroupBox控件的实现

《Qt中QGroupBox控件的实现》QGroupBox是Qt框架中一个非常有用的控件,它主要用于组织和管理一组相关的控件,本文主要介绍了Qt中QGroupBox控件的实现,具有一定的参考价值,感兴趣... 目录引言一、基本属性二、常用方法2.1 构造函数 2.2 设置标题2.3 设置复选框模式2.4 是否

QT进行CSV文件初始化与读写操作

《QT进行CSV文件初始化与读写操作》这篇文章主要为大家详细介绍了在QT环境中如何进行CSV文件的初始化、写入和读取操作,本文为大家整理了相关的操作的多种方法,希望对大家有所帮助... 目录前言一、CSV文件初始化二、CSV写入三、CSV读取四、QT 逐行读取csv文件五、Qt如何将数据保存成CSV文件前言

Qt中QUndoView控件的具体使用

《Qt中QUndoView控件的具体使用》QUndoView是Qt框架中用于可视化显示QUndoStack内容的控件,本文主要介绍了Qt中QUndoView控件的具体使用,具有一定的参考价值,感兴趣的... 目录引言一、QUndoView 的用途二、工作原理三、 如何与 QUnDOStack 配合使用四、自

Qt spdlog日志模块的使用详解

《Qtspdlog日志模块的使用详解》在Qt应用程序开发中,良好的日志系统至关重要,本文将介绍如何使用spdlog1.5.0创建满足以下要求的日志系统,感兴趣的朋友一起看看吧... 目录版本摘要例子logmanager.cpp文件main.cpp文件版本spdlog版本:1.5.0采用1.5.0版本主要

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 文件复制,移动(