当前位置:网站首页>PyQt theme
PyQt theme
2022-06-26 00:42:00 【M_qsqsqsq】
PyQt theme
1. Qt-Material
This is another stylesheet for PySide6, PySide2 and PyQt5, which looks like Material Design (close enough).
“一个仿Material的样式,适用于PySide6, PySide2以及PyQt5”
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-WG78xmNm-1656173085181)(E:\Typora\images\image-20220625225344690.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jN6NALvK-1656173085181)(E:\Typora\images\image-20220625225412945.png)]
主题包安装:pip install qt-material
主题应用:
# 使用例子
import sys
# from PySide6 import QtWidgets
# from PySide2 import QtWidgets
from PyQt5 import QtWidgets
from qt_material import apply_stylesheet
# create the application and the main window
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QMainWindow()
# setup stylesheet
apply_stylesheet(app, theme='dark_teal.xml')
# run
window.show()
app.exec_()
theme = ['dark_amber.xml',
'dark_blue.xml',
'dark_cyan.xml',
'dark_lightgreen.xml',
'dark_pink.xml',
'dark_purple.xml',
'dark_red.xml',
'dark_teal.xml',
'dark_yellow.xml',
'light_amber.xml',
'light_blue.xml',
'light_cyan.xml',
'light_cyan_500.xml',
'light_lightgreen.xml',
'light_pink.xml',
'light_purple.xml',
'light_red.xml',
'light_teal.xml',
'light_yellow.xml']
2. QDarkStyleSheet
The most complete dark/light style sheet for Qt applications
“最完整的深色/浅色Qt主题”
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-BAMDtJs6-1656173085181)(E:\Typora\images\image-20220625234446380.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-16oAYPll-1656173085181)(E:\Typora\images\image-20220625234541177.png)]
![(E:\Typora\images\image-20220625234459481.png)
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-yXRAE3lW-1656173085181)(C:\Users\sqqian\AppData\Roaming\Typora\typora-user-images\image-20220625234512282.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-pZgsT10E-1656173085182)(C:\Users\sqqian\AppData\Roaming\Typora\typora-user-images\image-20220625234516092.png)]
下载安装:pip install qdarkstyle
主题应用:
import sys
import qdarkstyle
from qdarkstyle.dark.palette import DarkPalette
from qdarkstyle.light.palette import LightPalette
from PyQt5 import QtWidgets
# create the application and the main window
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QMainWindow()
# 设置深色主题
app.setStyleSheet(qdarkstyle.load_stylesheet(qt_api="pyqt5", palette=DarkPalette))
# 设置浅色主题
# app.setStyleSheet(qdarkstyle.load_stylesheet(qt_api="pyqt5", palette=LightPalette))
# run
window.show()
app.exec_()
边栏推荐
猜你喜欢
随机推荐
Disruptor (I) sequence
Back to top case
Shell curl execution script, with passed parameters and user-defined parameters
Prompt to update to the latest debug version during vscode debugging
Shell learning record (I)
shell学习记录(二)
Getting to know OpenGL
Connectez Le projecteur
MySQL必须掌握4种语言!
Command of gun make (4) rule
Graphics rendering pipeline
win32
如何制定一个可实现的年度目标?
Small ball bouncing against the wall
记录一个诡异的图片上传问题
Abnova anti GBA monoclonal antibody solution
socket demo01
[untitled] vsbiji ESP thirty-two
weishi相机显示
Calibration...