当前位置: 首页 > news >正文

PySide6||QPushButton的QSS样式

1、狗狗拜按钮

QQ202484-03338 (online-video-cutter.com)

/* QPushButton的基本样式 */  
QPushButton {  background-image:url(:/xxx/第1帧.png); /* 设置背景图片 */  background-repeat: no-repeat; /* 不重复背景图片 */  background-position: center; /* 将背景图片居中 */  border: none; /* 移除边框,如果需要边框请自行设置 */  /* 其他样式,如字体、内边距等 */  font-size: 16px;  padding: 10px; /* 根据需要调整内边距 */  
}  /* QPushButton在鼠标悬停时的样式 */  
QPushButton:hover {  background-image:url(:/xxx/第2帧.png);
}  /* QPushButton在被按下时的样式 */  
QPushButton:pressed {  background-image:url(:/xxx/第1帧.png);
}  /* 如果需要禁用状态的样式 */  
QPushButton:disabled {  /* 设置禁用状态的样式 */  background-image: url('path_to_disabled_background.png'); /* 可能的禁用状态图片 */  color: gray; /* 更改文字颜色为灰色 */  
}

2、 

/* 默认按钮样式 */  
QPushButton {  background-color: #555; /* 背景色设置为 #555 */  color: white; /* 文字颜色设置为白色 */  border: 1px solid #333; /* 边框颜色设置为 #333,宽度为1px */  border-radius: 6px; /* 边框圆角 */  padding: 3px 6px; /* 内边距 */  
}  /* 鼠标悬停时的样式 */  
QPushButton:hover {  background-color: #888; /* 背景色加深为 #666 */  border-color: #555; /* 边框颜色也稍微加深 */  
}  /* 按钮被按下时的样式 */  
QPushButton:pressed {  background-color: #333; /* 背景色变为更深的 #333 */  border-color: #222; /* 边框颜色也相应变深 */  
}  /* 禁用状态的按钮样式 */  
QPushButton:disabled {  background-color: #888; /* 背景色变为较浅的灰色 #888 */  color: #ccc; /* 文字颜色变浅 */  border-color: #666; /* 边框颜色也相应变浅 */  
}

3、

QPushButton {  background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,  stop: 0 #ff8080, stop: 1 #ff0000); /* 红色渐变背景 */  color: white; /* 文字颜色 */  border: none; /* 去除边框 */  border-radius: 10px; /* 圆角边框 */  padding: 10px 20px; /* 内边距 */  font-size: 16px; /* 字体大小 */  font-weight: bold; /* 字体加粗 */  transition: background-color 0.3s ease-in-out; /* 背景色过渡效果 */  
}  QPushButton:hover {  background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,  stop: 0 #ff0000, stop: 1 #800000); /* 加深的红色渐变 */  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 添加阴影效果 */  
}  QPushButton:pressed {  background-color: #800000; /* 按下时的背景色 */  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.2); /* 按下时的内阴影效果 */  
}  QPushButton:disabled {  background-color: #ccc; /* 禁用时的背景色 */  color: #888; /* 禁用时的文字颜色 */  
}

图片素材:

http://www.lryc.cn/news/418664.html

相关文章:

  • HarmonyOS鸿蒙应用开发之ArkTS基本语法
  • Web开发-CSS篇-上
  • 在mac上通过 MySQL 安装包安装 MySQL 之后,终端执行 mysql 命令报错 command not found: mysql
  • Unity入门4——常用接口
  • 职业教育云计算实验实训室建设应用案例
  • MySQL-MHA高可用配置及故障切换
  • Sentinel 滑动时间窗口源码分析
  • 猎码安卓APP开发IDE,amix STUDIO中文java,HTML5开发工具
  • 【Deep-ML系列】Linear Regression Using Gradient Descent(手写梯度下降)
  • NVIDIA A100 和 H100 硬件架构学习
  • 企业研发设计协同解决方案
  • iOS 18(macOS 15)Vision 中新增的任意图片智能评分功能试玩
  • 如何实现若干子任务一损俱损--浅谈errgroup
  • 并查集的基础题
  • [论文翻译] LTAChecker:利用注意力时态网络基于 Dalvik 操作码序列的轻量级安卓恶意软件检测
  • HTTPS链接建立的过程
  • 文档控件DevExpress Office File API v24.1 - 支持基于Unix系统的打印
  • IP地址封装类(InetAddress类)
  • 数据库设计规范化
  • 预约咨询小程序搭建教程,源码获取,从0到1完成开发并部署上线
  • leetcode217. 存在重复元素,哈希表秒解
  • QT:QString 支持 UTF-8 编码吗?
  • 我主编的电子技术实验手册(13)——电磁元件之继电器
  • odoo from样式更新
  • Oracle(52)分区表有哪些类型?
  • 大黄蜂能飞的起来吗?
  • 虹科新品 | PDF记录仪新增蓝牙®接口型号HK-LIBERO CL-Y
  • Bytebase 2.22.1 - SQL 编辑器展示更丰富的 Schema 信息
  • SQL Server Management Studio的使用
  • Python 爬虫项目实战一:抖音视频下载与网易云音乐下载