凌的博客

您现在的位置是: 首页 > 学无止境 > python > 

python

PyQt5 加载外部qss样式

2020-10-10 python 2147
# 加载操作
qssStyle = CommonHelper.readQss("./static/style.qss")
self.setStyleSheet(qssStyle)

#读取方法
class CommonHelper:

    def __init__(self):
        pass

    @staticmethod
    def readQss(style):
        with open(style,"r") as f:
            return f.read()


文章评论

0条评论