当前位置:网站首页>PyQt theme

PyQt theme

2022-06-26 02:17:00 M_ qsqsqsq

PyQt theme

1. Qt-Material

UN-GCPDS/qt-material

This is another stylesheet for PySide6, PySide2 and PyQt5, which looks like Material Design (close enough).

“ A copy Material The style of , Apply to PySide6, PySide2 as well as PyQt5”

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-WG78xmNm-1656173085181)(E:\Typora\images\image-20220625225344690.png)]

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-jN6NALvK-1656173085181)(E:\Typora\images\image-20220625225412945.png)]

Theme pack installation :pip install qt-material

Theme applications :

#  Examples of use 
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

“ The most complete dark / light colour Qt The theme ”

file

GitHub

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-BAMDtJs6-1656173085181)(E:\Typora\images\image-20220625234446380.png)]

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-16oAYPll-1656173085181)(E:\Typora\images\image-20220625234541177.png)]

![(E:\Typora\images\image-20220625234459481.png)

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-yXRAE3lW-1656173085181)(C:\Users\sqqian\AppData\Roaming\Typora\typora-user-images\image-20220625234512282.png)]

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-pZgsT10E-1656173085182)(C:\Users\sqqian\AppData\Roaming\Typora\typora-user-images\image-20220625234516092.png)]

Download and install :pip install qdarkstyle

Theme applications :

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()
#  Set a dark theme 
app.setStyleSheet(qdarkstyle.load_stylesheet(qt_api="pyqt5", palette=DarkPalette))
#  Set light theme 
# app.setStyleSheet(qdarkstyle.load_stylesheet(qt_api="pyqt5", palette=LightPalette))

# run
window.show()
app.exec_()
原网站

版权声明
本文为[M_ qsqsqsq]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206260042466034.html