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

Python的界面美化库 qt-material

Python的界面美化库 qt-material

    • 1、先看效果
    • 2、github地址
    • 3、基础用法

1、先看效果

在这里插入图片描述

2、github地址

qt-material项目地址:https://github.com/dunderlab/qt-material
示例地址:https://github.com/UN-GCPDS/qt-material

3、基础用法

参考官方文档:https://qt-material.readthedocs.io/en/latest/index.html

本质上就是一个全局的qss,设置应用程序的setStyleSheet,如下qt-materialsetStyleSheet源码所示。

def apply_stylesheet(app,theme="",style="Fusion",save_as=None,invert_secondary=False,extra={},parent="theme",css_file=None,
):""""""if style:try:app.setStyle(style)except:logging.warning(f"The style '{style}' does not exist.")passif "QMenu" in extra:for k in extra["QMenu"]:extra[f"qmenu_{k}"] = extra["QMenu"][k]extra["QMenu"] = Truestylesheet = build_stylesheet(theme, invert_secondary, extra, parent)if stylesheet is None:returnif save_as:with open(save_as, "w") as file:file.writelines(stylesheet)if css_file and os.path.exists(css_file):with open(css_file) as file:stylesheet += file.read().format(**os.environ)app.setStyleSheet(stylesheet)
http://www.dtcms.com/a/285380.html

相关文章:

  • 【机器学习】安装Jupyter及基本操作
  • Android如何使用Linux Quota管控app对userdata分区的磁盘空间使用
  • QT聊天项目DAY15
  • 数据结构入门:像整理收纳一样简单!
  • 【git仓库搭建笔记】
  • 二、Dify 版本升级教程(LInux-openeuler)
  • react/vue vite ts项目中,自动引入路由文件、 import.meta.glob动态引入路由 无需手动引入
  • cartorgapher的编译与运行
  • 需要保存至服务器的:常见编辑、发布文章页面基础技巧
  • Machine Learning HW2 report:语音辨识(Hongyi Lee)
  • 如何防止GitHub上的敏感信息被泄漏?
  • Jenkins+Docker+Git实现自动化CI/CD
  • 大带宽服务器都有哪些应用场景?
  • 群晖中相册管理 immich大模型的使用
  • Honeywell霍尼韦尔DV-10 变速器放大器 输入 15-28 VDC,输出 +/- 10VDC 060-6881-02
  • 【HCI log】Google Pixel 手机抓取hci log
  • HTTP 性能优化:五条建议
  • 构建智能客服Agent:从需求分析到生产部署
  • UGUI 性能优化系列:第二篇——Canvas 与 UI 元素管理
  • 如何选择旅游科技行业云ERP?Oracle NetSuite助力汇智国际数智化升级
  • Oracle 19C 后台主要进程的功能解析
  • (LeetCode 面试经典 150 题 ) 242. 有效的字母异位词 (哈希表)
  • nginx-http反向代理与负载均衡
  • 大规模图计算引擎的分区与通信优化:负载均衡与网络延迟的解决方案
  • Nginx配置Spring Boot集群:负载均衡+静态资源分离实战
  • 百度权重提升技巧分析:从底层逻辑到实战策略
  • x86上编译jetson nano的docker
  • 【Docker】在Linux环境下使用Dockerfile打包镜像(图文示例)
  • Spring中的设计模式
  • 因果图方法设计测试用例的价值与使用范围