QT设置当窗口全屏的时候,部件跟随全屏显示大小

QGridLayout *mainLayout =new QGridLayout(this);

    mainLayout -> addWidget(tree, 0, 0);

    mainLayout -> addWidget(stackedWidget, 0, 1);

 

    mainLayout -> setColumnStretch(0,3);

    mainLayout -> setColumnStretch(1,5);

 

    mainLayout -> setRowStretch(0, 1);

    mainLayout -> setRowStretch(1, 0);

    widget->setLayout(mainLayout);

    setCentralWidget(widget);

你可能感兴趣的:(QT学习)