widget跟随窗口调整大小


class UiMainWindow(QtWidgets.QMainWindow):
    def __init__(self):
        self.maya_mainwindow = frequency_func.maya_mainwindow()
        super(UiMainWindow, self).__init__(self.maya_mainwindow)
        self.setupUi()

    def setupUi(self):
        self.setObjectName("box_window")
        self.setWindowTitle(u'羊神盒子仿制版')
        self.resize(500, 800)
        
        # 设置中心widget及布局
        self.centralwidget = QtWidgets.QWidget(self)
        self.setCentralWidget(self.centralwidget)
        self.window_layout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.setLayout(self.window_layout)
        
        # 在布局中增加控机
        bottom = QtWidgets.QFrame()
        self.window_layout.addWidget(bottom)
        
        

评论
  目录