from PyQt5.QtGui import QFont from PyQt5.QtWidgets import * class ChangeTheme(QLabel): def __init__(self): super(ChangeTheme, self).__init__() self.setScaledContents(True) self.widget = QWidget() self.label = QLabel('主题') layout = QVBoxLayout() layout.addWidget(self.label) self.widget.setLayout(layout) self.widget.show()