Qt : Style Sheet

When a style sheet is active, the QStyle returned by QWidget::style() is a wrapper “style sheet” style, not the platform-specific style. The wrapper style ensures that any active style sheet is respected and otherwise forwards the drawing operations to the underlying, platform-specific style (e.g., QWindowsVistaStyle on Windows).

A style rule is made up of a selector and a declaration.

Qt Style Sheet is generally case insensitive (i.e., color, Color, COLOR, and cOloR refer to the same property). The only exceptions are class names, object names, and Qt property names, which are case sensitive.
Several selectors can be specified for the same declaration, using commas (,) to separate the selectors. For example, the rule
QPushButton, QLineEdit, QComboBox { color: red }
is equivalent to this sequence of three rules:
QPushButton { color: red }
QLineEdit { color: red }
QComboBox { color: red }

The declaration part of a style rule is a list of property: value pairs, enclosed in braces ({}) and separated with semicolons. For example:
QPushButton { color: red; background-color: white }

The background of any QAbstractScrollArea (Item views, QTextEdit and QTextBrowser) can be set using the background properties. For example, to set a background-image that scrolls with the scroll bar:
QTextEdit, QListView {
background-color: white;
background-image: url(draft.png);
background-attachment: scroll;
}
在这里插入图片描述

If the background-image is to be fixed with the viewport:
QTextEdit, QListView {
background-color: white;
background-image: url(draft.png);
background-attachment: fixed;
}
在这里插入图片描述

SelectorExampleExplanation
Universal Selector*Matches all widgets.
Type SelectorQPushButtonMatches instances of QPushButton and of its subclasses.
Property SelectorQPushButton[flat=“false”]Matches instances of QPushButton that are not flat. You may use this selector to test for any Qt property that supports QVariant::toString() (see the toString() function documentation for details). In addition, the special class property is supported, for the name of the class.This selector may also be used to test dynamic properties. For more information on customization using dynamic properties, refer to Customizing Using Dynamic Properties.
Class Selector.QPushButtonMatches instances of QPushButton, but not of its subclasses.
This is equivalent to *[class~=“QPushButton”].
ID SelectorQPushButton#okButtonMatches all QPushButton instances whose object name is okButton.
Descendant SelectorQDialog QPushButtonMatches all instances of QPushButton that are descendants (children, grandchildren, etc.) of a QDialog.
Child SelectorQDialog > QPushButtonMatches all instances of QPushButton that are direct children of a QDialog.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/651518.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Git(6)之使用HTTPS代理

Git(6)之使用代理网络传输 Author:onceday date:2024年1月27日 满满长路有人对你微笑过嘛… 全系列文章可查看专栏: Git使用记录_Once_day的博客-CSDN博客 1. 使用代理 如果你需要通过代理服务器来使用 Git,可以在 Git 的配置中设置代理…

消息中间件之RocketMQ(四)

RocketMQ高性能背后的核心原理 1.读队列与写队列 在RocketMQ的管理控制台创建Topic时,可以看到要单独设置读队列和写队列。 通常在运行时,都需要设置读队列写队列。perm字段表示Topic的权限,有三个可选项 2:禁写禁订阅 4: 可订阅…

golang实现一个简单的HTTP server

目标:用golang实现一个简单的HTTP Server,可以将POST的payload中的内容打印出来 golang环境准备 可以参考https://blog.csdn.net/ljyfree/article/details/123810868建议安装的版本最好是不低于golang-1.16 Server的实现 直接贴 adminhpc-1:~/go$ cat http_rpc_…

【前端web入门第二天】01 html语法实现列表与表格

html语法实现列表与表格 文章目录: 1.列表 1.1 无序列表1.2 有序列表1.3 定义列表 2.表格 2.1 表格基本结构2.2 表格结构标签 写在最前,第二天学习目标: 列表 表格 表单 元素为嵌套关系 1.列表 作用:布局内容排列整齐的区域。 列表分类:无序列表、有序列表、定义列表。 1…

pysot中eval多种算法比较和画图

安装miktex和Texwork,记得更新miktex,链接https://miktex.org/download, 参考https://blog.csdn.net/weixin_42495721/article/details/110855071 我用的是pysot官方的库,里面包括eval和test、train等py文件。 路径结构为&#x…

1.27回溯(中等)

1.全排列 全排列 II 1.给定一个不含重复数字的数组 nums ,返回其 所有可能的全排列 。你可以 按任意顺序 返回答案。 2.给定一个可包含重复数字的序列 nums ,按任意顺序 返回所有不重复的全排列。 示例 1: 输入:nums [1,2,3…

大数据期望最大化(EM)算法:从理论到实战全解析

文章目录 大数据期望最大化(EM)算法:从理论到实战全解析一、引言概率模型与隐变量极大似然估计(MLE)Jensen不等式 二、基础数学原理条件概率与联合概率似然函数Kullback-Leibler散度贝叶斯推断 三、EM算法的核心思想期…

鸿蒙(HarmonyOS)项目方舟框架(ArkUI)之Swiper容器组件

鸿蒙(HarmonyOS)项目方舟框架(ArkUI)之Swiper容器组件 一、操作环境 操作系统: Windows 10 专业版、IDE:DevEco Studio 3.1、SDK:HarmonyOS 3.1 二、Swiper容器组件 滑块视图容器,提供子组件滑动轮播显示的能力。…

【网站项目】基于SSM的228图书商城网站

🙊作者简介:拥有多年开发工作经验,分享技术代码帮助学生学习,独立完成自己的项目或者毕业设计。 代码可以私聊博主获取。🌹赠送计算机毕业设计600个选题excel文件,帮助大学选题。赠送开题报告模板&#xff…

openssl3.2 - 测试程序的学习 - 准备openssl测试专用工程的模板

文章目录 openssl3.2 - 测试程序的学习 - 准备openssl测试专用工程的模板概述笔记工程中需要的openssl的库实现END openssl3.2 - 测试程序的学习 - 准备openssl测试专用工程的模板 概述 openssl3.2 - 测试程序的学习 整了几个test.c, 每开一个新的测试工程, 总要改这改那的. …

Linux——进程间通信(共享内存)

目录 system V共享内存 ​编辑 共享内存函数 共享内存的建立过程 shmget函数 shmctl函数 shmat函数 shmdt函数 实例代码 共享内存的特点 system V共享内存 共享内存区是最快的IPC形式。一旦这样的内存映射到共享它的进程的地址空间(即内存通过某种映射关…

OpenCV-28 全局二值化

一、形态学概念 什么是形态学? 1)指一系列处理图像型状特征的图像处理技术 2)形态学的基本思想是利用一直特殊的结构元(本质上是卷积核,且这个卷积核的值只有1和0)来测量或提取输入图像中相应的型状或特…

深入了解Go语言中的HTTP代理处理机制

Go语言,也被称为Golang,自2009年诞生以来,凭借其简洁、高效的特点,逐渐在系统编程、Web开发等多个领域崭露头角。在Web开发中,HTTP代理处理是常见的需求之一。本文将深入探讨Go语言中的HTTP代理处理机制。 HTTP代理是…

【Java 数据结构】LinkedList与链表

LinkedList与链表 1. ArrayList的缺陷2. 链表2.1 链表的概念及结构2.2 链表的实现 3. LinkedList的模拟实现4.LinkedList的使用4.1 什么是LinkedList4.2LinkedList的使用 5. ArrayList和LinkedList的区别 1. ArrayList的缺陷 上节课已经熟悉了ArrayList的使用,并且…

【linux】Linux项目自动化构建工具-make/Makefile

make/makefile 背景 会不会写makefile,从一个侧面说明了一个人是否具备完成大型工程的能力 一个工程中的源文件不计数,其按类型、功能、模块分别放在若干个目录中,makefile定义了一系列的规则来指定,哪些文件需要先编译&#xff0…

Java笔记 --- 二、Stream流

二、Stream流 结合Lambda表达式,简化集合、数组的操作 获取Stream流对象 单列集合获取Stream流 双列集合获取Stream流 数组获取Stream流 一堆零散的数据获取Stream流 Stream流的静态方法of的形参是一个可变参数,可以传递零散数据,也可以传递…

【计算机网络】IP协议及动态路由算法

对应代码包传送门 IP协议及动态路由算法代码包及思科模拟器资料说明 相关文章 【计算机网络】中小型校园网构建与配置 【计算机网络】Socket通信编程与传输协议分析 【计算机网络】网络应用通信基本原理 目的: 1、掌握IP协议,IP分片,DH…

Ubuntu上 RISC-V64 Jemalloc 编译补丁(修复无法链接问题)

它的问题跟这个是相同的; RISC-V平台 std::atomic<T> 编译失败问题解决-CSDN博客 区别是自己写的代码,能改掉,但是 Jemalloc 编译好的静态库。 比如:我们是在其它平台上面交叉编译的 RISC-V程序&#xff0…

获取el-select的label

获取el-select的label 使用click.navite 在 el-option 中添加 clik.native 在方法的传参中传入自己需要的内容 这个方法同样适用于 element-plus <template><el-select v-model"selectValue"><el-option v-for"item in options" :key&q…

04. OSPF

文章目录 一. 初识OSPF1.1. OSPF概述1.2. OSPF特性1.3. OSPF的专业术语1.4. OSPF维护的3张表1.5. OSPF报文类型1.6. OSPF的邻居状态 二. 实验题2.1. 实验1&#xff1a;点到点链路上的OSPF2.1.1. 实验目的2.1.2. 实验拓扑图2.1.3. 实验步骤&#xff08;1&#xff09;IP地址配置&…