PYQT中QSS包的使用

    技术2022-07-12  67

    #加载QSS美化类

    class CommonHelper: def __init__(self): pass @staticmethod def readQss(style): with open(style, 'r') as f: return f.read() if __name__ == "__main__": app = QApplication(sys.argv) ui = MyMainWindow() path = os.getcwd() stylefile=path+"\\QSSFile"+"\\abc.qss" qssstyle=CommonHelper.readQss(stylefile) ui.setStyleSheet(qssstyle) ui.show() # 界面显示动作 sys.exit(app.exec()) # 程序执行完毕后关闭
    Processed: 0.012, SQL: 9